diff options
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/path-util.c | 2 | ||||
-rw-r--r-- | src/basic/process-util.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 537705446a..8f49d65266 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -528,7 +528,7 @@ int fd_is_mount_point(int fd, const char *filename, int flags) { * * If that didn't work we will try to read the mount id from * /proc/self/fdinfo/<fd>. This is almost as good as - * name_to_handle_at(), however, does not return the the + * name_to_handle_at(), however, does not return the * opaque file handle. The opaque file handle is pretty useful * to detect the root directory, which we should always * consider a mount point. Hence we use this only as diff --git a/src/basic/process-util.c b/src/basic/process-util.c index cfc876567d..2c05f2fee4 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -329,6 +329,9 @@ int get_process_environ(pid_t pid, char **env) { sz += cescape_char(c, outcome + sz); } + if (sz == 0) + return -ENOENT; + outcome[sz] = '\0'; *env = outcome; outcome = NULL; |