projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
procd: Replace strerror(errno) with %m.
[project/procd.git]
/
service
/
instance.c
diff --git
a/service/instance.c
b/service/instance.c
index 35804de7c19e2e4d1c666d92c1316ddbbec1e213..25735ab28097e1add078d8b6caad1cff258d9744 100644
(file)
--- a/
service/instance.c
+++ b/
service/instance.c
@@
-241,8
+241,8
@@
instance_removepid(struct service_instance *in) {
if (!in->pidfile)
return 0;
if (unlink(in->pidfile)) {
if (!in->pidfile)
return 0;
if (unlink(in->pidfile)) {
- ERROR("Failed to removed pidfile: %s: %d - %
s
\n",
- in->pidfile, errno
, strerror(errno)
);
+ ERROR("Failed to removed pidfile: %s: %d - %
m
\n",
+ in->pidfile, errno);
return 1;
}
return 0;
return 1;
}
return 0;
@@
-258,19
+258,19
@@
instance_writepid(struct service_instance *in)
}
_pidfile = fopen(in->pidfile, "w");
if (_pidfile == NULL) {
}
_pidfile = fopen(in->pidfile, "w");
if (_pidfile == NULL) {
- ERROR("failed to open pidfile for writing: %s: %d (%
s
)",
- in->pidfile, errno
, strerror(errno)
);
+ ERROR("failed to open pidfile for writing: %s: %d (%
m
)",
+ in->pidfile, errno);
return 1;
}
if (fprintf(_pidfile, "%d\n", in->proc.pid) < 0) {
return 1;
}
if (fprintf(_pidfile, "%d\n", in->proc.pid) < 0) {
- ERROR("failed to write pidfile: %s: %d (%
s
)",
- in->pidfile, errno
, strerror(errno)
);
+ ERROR("failed to write pidfile: %s: %d (%
m
)",
+ in->pidfile, errno);
fclose(_pidfile);
return 2;
}
if (fclose(_pidfile)) {
fclose(_pidfile);
return 2;
}
if (fclose(_pidfile)) {
- ERROR("failed to close pidfile: %s: %d (%
s
)",
- in->pidfile, errno
, strerror(errno)
);
+ ERROR("failed to close pidfile: %s: %d (%
m
)",
+ in->pidfile, errno);
return 3;
}
return 3;
}
@@
-353,11
+353,11
@@
instance_run(struct service_instance *in, int _stdout, int _stderr)
}
if (in->gid && setgid(in->gid)) {
}
if (in->gid && setgid(in->gid)) {
- ERROR("failed to set group id %d: %d (%
s)\n", in->gid, errno, strerror(errno)
);
+ ERROR("failed to set group id %d: %d (%
m)\n", in->gid, errno
);
exit(127);
}
if (in->uid && setuid(in->uid)) {
exit(127);
}
if (in->uid && setuid(in->uid)) {
- ERROR("failed to set user id %d: %d (%
s)\n", in->uid, errno, strerror(errno)
);
+ ERROR("failed to set user id %d: %d (%
m)\n", in->uid, errno
);
exit(127);
}
exit(127);
}
@@
-407,14
+407,14
@@
instance_start(struct service_instance *in)
instance_free_stdio(in);
if (in->_stdout.fd.fd > -2) {
if (pipe(opipe)) {
instance_free_stdio(in);
if (in->_stdout.fd.fd > -2) {
if (pipe(opipe)) {
- ULOG_WARN("pipe() failed: %d (%
s)\n", errno, strerror(errno)
);
+ ULOG_WARN("pipe() failed: %d (%
m)\n", errno
);
opipe[0] = opipe[1] = -1;
}
}
if (in->_stderr.fd.fd > -2) {
if (pipe(epipe)) {
opipe[0] = opipe[1] = -1;
}
}
if (in->_stderr.fd.fd > -2) {
if (pipe(epipe)) {
- ULOG_WARN("pipe() failed: %d (%
s)\n", errno, strerror(errno)
);
+ ULOG_WARN("pipe() failed: %d (%
m)\n", errno
);
epipe[0] = epipe[1] = -1;
}
}
epipe[0] = epipe[1] = -1;
}
}