***/
#include <linux/oom.h>
-#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
#include <fcntl.h>
#include <sched.h>
-#include <sys/prctl.h>
-#include <sys/mount.h>
#include <linux/fs.h>
#include <sys/stat.h>
-#include <sys/time.h>
#include <sys/resource.h>
-#include <sys/types.h>
-#include <grp.h>
#ifdef HAVE_SECCOMP
#include <seccomp.h>
#endif
-#include "sd-messages.h"
#include "unit.h"
#include "strv.h"
#include "conf-parser.h"
}
found:
- n = new(char*, k + !separate_argv0);
+ /* If separate_argv0, we'll move first element to path variable */
+ n = new(char*, MAX(k + !separate_argv0, 1u));
if (!n)
return log_oom();
for (a = b = u->documentation; a && *a; a++) {
- if (is_valid_documentation_url(*a))
+ if (documentation_url_is_valid(*a))
*(b++) = *a;
else {
log_syntax(unit, LOG_ERR, filename, line, EINVAL,
FOREACH_WORD(word, l, rvalue, state) {
_cleanup_free_ char *temp;
int val;
+ Set **set;
temp = strndup(word, l);
if (!temp)
if (val <= 0) {
log_syntax(unit, LOG_ERR, filename, line, -val,
"Failed to parse value, ignoring: %s", word);
- return 0;
+ continue;
}
+ set = &status_set->signal;
} else {
if (val < 0 || val > 255) {
log_syntax(unit, LOG_ERR, filename, line, ERANGE,
"Value %d is outside range 0-255, ignoring", val);
continue;
}
+ set = &status_set->status;
}
- r = set_ensure_allocated(&status_set->status, NULL);
+ r = set_ensure_allocated(set, NULL);
if (r < 0)
return log_oom();
- r = set_put(status_set->status, INT_TO_PTR(val));
+ r = set_put(*set, INT_TO_PTR(val));
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, -r,
"Unable to store: %s", word);
f = fdopen(fd, "re");
if (!f) {
- r = -errno;
safe_close(fd);
- return r;
+ return -errno;
}
*_f = f;