sigerr = signal(i, SIG_DFL);
if (sigerr == SIG_ERR) {
- DEBUG("%s - Failed to reset to default action "
- "for signal \"%d\": %d", strerror(errno),
- i, pid);
+ SYSDEBUG("Failed to reset to default action "
+ "for signal \"%d\": %d", i, pid);
}
}
} else {
ret = kill(-1, SIGTERM);
if (ret < 0)
- DEBUG("%s - Failed to send SIGTERM to "
- "all children", strerror(errno));
+ SYSDEBUG("Failed to send SIGTERM to all children");
}
alarm(1);
}
} else {
ret = kill(-1, SIGKILL);
if (ret < 0)
- DEBUG("%s - Failed to send SIGTERM to "
- "all children", strerror(errno));
+ SYSDEBUG("Failed to send SIGTERM to all children");
}
break;
}
default:
ret = kill(pid, was_interrupted);
if (ret < 0)
- DEBUG("%s - Failed to send signal \"%d\" to "
- "%d", strerror(errno), was_interrupted, pid);
+ SYSDEBUG("Failed to send signal \"%d\" to %d", was_interrupted, pid);
break;
}
ret = EXIT_SUCCESS;
ret = mknod(fifo_path, S_IFIFO|S_IRUSR|S_IWUSR, 0);
if (ret < 0 && errno != EEXIST) {
- INFO("Failed to mknod monitor fifo %s: %s.", fifo_path, strerror(errno));
+ SYSINFO("Failed to mknod monitor fifo %s", fifo_path);
return -1;
}
client_fd = lxc_cmd_send(name, cmd, lxcpath, hashed_sock_name);
if (client_fd < 0) {
- TRACE("%s - Command \"%s\" failed to connect command socket",
- strerror(errno), lxc_cmd_str(cmd->req.cmd));
+ SYSTRACE("Command \"%s\" failed to connect command socket",
+ lxc_cmd_str(cmd->req.cmd));
if (client_fd == -ECONNREFUSED)
*stopped = 1;
rootfs);
if (ret < 0) {
if (optional) {
- INFO("%s - Failed to mount \"%s\" on \"%s\" "
- "(optional)", strerror(errno),
- srcpath ? srcpath : "(null)", target);
+ SYSINFO("Failed to mount \"%s\" on \"%s\" (optional)",
+ srcpath ? srcpath : "(null)", target);
return 0;
}
ret = mount(srcpath, target, fstype, mountflags | MS_REMOUNT, data);
if (ret < 0) {
if (optional) {
- INFO("Failed to mount \"%s\" on \"%s\" "
- "(optional): %s",
- srcpath ? srcpath : "(null)", target,
- strerror(errno));
+ SYSINFO("Failed to mount \"%s\" on \"%s\" (optional)",
+ srcpath ? srcpath : "(null)", target);
return 0;
}
ret = mount(NULL, target, NULL, pflags, NULL);
if (ret < 0) {
if (optional) {
- INFO("%s - Failed to change mount propagation "
- "for \"%s\" (optional)", strerror(errno), target);
+ SYSINFO("Failed to change mount propagation "
+ "for \"%s\" (optional)", target);
return 0;
} else {
SYSERROR("Failed to change mount propagation "
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#define _GNU_SOURCE
#include <sys/prctl.h>
#include "initutils.h"
if (ret == 0)
(void)strlcpy((char*)arg_start, title, len);
else
- INFO("setting cmdline failed - %s", strerror(errno));
+ SYSINFO("setting cmdline failed");
return ret;
}
ret = ovl_remount_on_enodev(lower, bdev->dest, ovl_name,
MS_MGC_VAL | mntflags, options_work);
if (ret < 0) {
- INFO("Failed to mount \"%s\" on \"%s\" with options \"%s\". "
- "Retrying without workdir: %s",
- lower, bdev->dest, options_work, strerror(errno));
+ SYSINFO("Failed to mount \"%s\" on \"%s\" with options \"%s\". "
+ "Retrying without workdir",
+ lower, bdev->dest, options_work);
/* Assume we cannot use a workdir as we are on a version <= v21.
*/
}
if (mount(cbarg->rootfs, cbarg->target, fstype, mntflags, mntdata)) {
- DEBUG("mount failed with error: %s", strerror(errno));
+ SYSDEBUG("mount failed with error");
free(mntdata);
return 0;
}
lxc_list_add_tail(&lxc_ttys, &ts->node);
ret = sigaddset(&mask, SIGWINCH);
if (ret < 0)
- NOTICE("%s - Failed to add SIGWINCH to signal set",
- strerror(errno));
+ SYSNOTICE("Failed to add SIGWINCH to signal set");
}
/* Exit the mainloop cleanly on SIGTERM. */
if (w != r)
WARN("Short write on terminal r:%d != w:%d", r, w);
- if (w_rbuf < 0)
- TRACE("%s - Failed to write %d bytes to terminal ringbuffer",
- strerror(-w_rbuf), r);
+ if (w_rbuf < 0) {
+ errno = -w_rbuf;
+ SYSTRACE("Failed to write %d bytes to terminal ringbuffer", r);
+ }
if (w_log < 0)
TRACE("Failed to write %d bytes to terminal log", r);
if (terminal->peer < 0) {
if (!terminal->path) {
errno = ENODEV;
- DEBUG("%s - The process does not have a controlling "
- "terminal", strerror(errno));
+ SYSDEBUG("The process does not have a controlling terminal");
goto on_succes;
}
if (f) {
int ret = fread(&seed, sizeof(seed), 1, f);
if (ret != 1)
- DEBUG("unable to fread /dev/urandom, %s, fallback to time+pid rand seed", strerror(errno));
+ SYSDEBUG("unable to fread /dev/urandom, fallback to time+pid rand seed");
+
fclose(f);
}