Saves 1472 bytes under glibc. No other difference.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
err = handle_mount(pr->dev, target, pr->type, m);
if (err)
- ULOG_ERR("mounting %s (%s) as %s failed (%d) - %s\n",
- pr->dev, pr->type, target, errno, strerror(errno));
+ ULOG_ERR("mounting %s (%s) as %s failed (%d) - %m\n",
+ pr->dev, pr->type, target, errno);
else
handle_swapfiles(true);
return err;
err = handle_mount(pr->dev, target, pr->type, NULL);
if (err)
- ULOG_ERR("mounting %s (%s) as %s failed (%d) - %s\n",
- pr->dev, pr->type, target, errno, strerror(errno));
+ ULOG_ERR("mounting %s (%s) as %s failed (%d) - %m\n",
+ pr->dev, pr->type, target, errno);
else
handle_swapfiles(true);
return err;
err = umount2(mp, MNT_DETACH);
if (err)
- ULOG_ERR("unmounting %s (%s) failed (%d) - %s\n",
- pr->dev, mp, errno, strerror(errno));
+ ULOG_ERR("unmounting %s (%s) failed (%d) - %m\n",
+ pr->dev, mp, errno);
else
ULOG_INFO("unmounted %s (%s)\n",
pr->dev, mp);
err = umount2(mount_point, MNT_DETACH);
if (err)
- ULOG_ERR("umount of %s failed (%d) - %s\n",
- mount_point, errno, strerror(errno));
+ ULOG_ERR("umount of %s failed (%d) - %m\n",
+ mount_point, errno);
free(mount_point);
return 0;
if (stat(tag, &s)) {
fp = fopen(tag, "w+");
if (!fp) {
- ULOG_ERR("extroot: failed to write UUID to %s: %d (%s)\n",
- tag, errno, strerror(errno));
+ ULOG_ERR("extroot: failed to write UUID to %s: %d (%m)\n",
+ tag, errno);
/* return 0 to continue boot regardless of error */
return 0;
}
fp = fopen(tag, "r");
if (!fp) {
- ULOG_ERR("extroot: failed to read UUID from %s: %d (%s)\n",
- tag, errno, strerror(errno));
+ ULOG_ERR("extroot: failed to read UUID from %s: %d (%m)\n",
+ tag, errno);
return -1;
}
if (!fgets(uuid, sizeof(uuid), fp))
- ULOG_ERR("extroot: failed to read UUID from %s: %d (%s)\n",
- tag, errno, strerror(errno));
+ ULOG_ERR("extroot: failed to read UUID from %s: %d (%m)\n",
+ tag, errno);
fclose(fp);
if (*uuid && !strcasecmp(uuid, pr->uuid))
(m->options) ? (m->options) : (""));
if (err) {
- ULOG_ERR("extroot: mounting %s (%s) on %s failed: %d (%s)\n",
- pr->dev, pr->type, path, errno, strerror(errno));
+ ULOG_ERR("extroot: mounting %s (%s) on %s failed: %d (%m)\n",
+ pr->dev, pr->type, path, errno);
} else if (m->overlay) {
err = check_extroot(path);
if (err)
close(fd);
if (sz != 4) {
- ULOG_ERR("writing %s failed: %s\n", v->blk, strerror(errno));
+ ULOG_ERR("writing %s failed: %m\n", v->blk);
return -1;
}
int ret = -1;
if (!fp) {
- ULOG_ERR("opening /proc/filesystems failed: %s\n", strerror(errno));
+ ULOG_ERR("opening /proc/filesystems failed: %m\n");
goto out;
}
ret = mount(olddir, newdir, NULL, MS_NOATIME | MS_MOVE, NULL);
/* if (ret)
- ULOG_ERR("failed %s %s: %s\n", olddir, newdir, strerror(errno));*/
+ ULOG_ERR("failed %s %s: %m\n", olddir, newdir);*/
return ret;
}
ret = pivot_root(new, pivotdir);
if (ret < 0) {
- ULOG_ERR("pivot_root failed %s %s: %s\n", new, pivotdir, strerror(errno));
+ ULOG_ERR("pivot_root failed %s %s: %m\n", new, pivotdir);
return -1;
}
/* Mainlined overlayfs has been renamed to "overlay", try that first */
if (mount(overlay, "/mnt", "overlay", MS_NOATIME, mount_options)) {
if (mount(overlay, "/mnt", "overlayfs", MS_NOATIME, mount_options)) {
- ULOG_ERR("mount failed: %s, options %s\n",
- strerror(errno), mount_options);
+ ULOG_ERR("mount failed: %s, options %m\n", mount_options);
return -1;
}
}
sz = read(p->fd, &deadc0de, sizeof(deadc0de));
if (sz != sizeof(deadc0de)) {
- ULOG_ERR("reading %s failed: %s\n", v->name, strerror(errno));
+ ULOG_ERR("reading %s failed: %m\n", v->name);
return -1;
}
ret = ioctl(p->fd, MEMGETINFO, &mtdinfo);
if (ret) {
- ULOG_ERR("ioctl(%d, MEMGETINFO) failed: %s\n", p->fd, strerror(errno));
+ ULOG_ERR("ioctl(%d, MEMGETINFO) failed: %m\n", p->fd);
} else {
struct erase_info_user mtdlock;
overlay_mount(struct volume *v, char *fs)
{
if (mkdir("/tmp/overlay", 0755)) {
- ULOG_ERR("failed to mkdir /tmp/overlay: %s\n", strerror(errno));
+ ULOG_ERR("failed to mkdir /tmp/overlay: %m\n");
return -1;
}
if (mount(v->blk, "/tmp/overlay", fs, MS_NOATIME, NULL)) {
- ULOG_ERR("failed to mount -t %s %s /tmp/overlay: %s\n", fs, v->blk, strerror(errno));
+ ULOG_ERR("failed to mount -t %s %s /tmp/overlay: %m\n", fs, v->blk);
return -1;
}
ret = mount(v->blk, "/rom/overlay", "jffs2", MS_NOATIME, NULL);
unlink("/tmp/.switch_jffs2");
if (ret) {
- ULOG_ERR("failed - mount -t jffs2 %s /rom/overlay: %s\n", v->blk, strerror(errno));
+ ULOG_ERR("failed - mount -t jffs2 %s /rom/overlay: %m\n", v->blk);
return -1;
}
if (mount("none", "/", NULL, MS_NOATIME | MS_REMOUNT, 0)) {
- ULOG_ERR("failed - mount -o remount,ro none: %s\n", strerror(errno));
+ ULOG_ERR("failed - mount -o remount,ro none: %m\n");
return -1;
}
if (system("cp -a /tmp/root/* /rom/overlay")) {
- ULOG_ERR("failed - cp -a /tmp/root/* /rom/overlay: %s\n", strerror(errno));
+ ULOG_ERR("failed - cp -a /tmp/root/* /rom/overlay: %m\n");
return -1;
}
if (pivot("/rom", "/mnt")) {
- ULOG_ERR("failed - pivot /rom /mnt: %s\n", strerror(errno));
+ ULOG_ERR("failed - pivot /rom /mnt: %m\n");
return -1;
}
if (mount_move("/mnt", "/tmp/root", "")) {
- ULOG_ERR("failed - mount -o move /mnt /tmp/root %s\n", strerror(errno));
+ ULOG_ERR("failed - mount -o move /mnt /tmp/root %m\n");
return -1;
}
char *fstype = overlay_fs_name(volume_identify(v));
if (mkdir("/tmp/overlay", 0755)) {
- ULOG_ERR("failed to mkdir /tmp/overlay: %s\n", strerror(errno));
+ ULOG_ERR("failed to mkdir /tmp/overlay: %m\n");
return -1;
}
if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME, NULL)) {
- ULOG_ERR("failed to mount -t %s %s /tmp/overlay: %s\n",
- fstype, v->blk, strerror(errno));
+ ULOG_ERR("failed to mount -t %s %s /tmp/overlay: %m\n",
+ fstype, v->blk);
return -1;
}
close(fd);
if (sz != 1) {
- ULOG_ERR("writing %s failed: %s\n", v->blk, strerror(errno));
+ ULOG_ERR("writing %s failed: %m\n", v->blk);
return -1;
}