aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/firejail/fs_dev.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/firejail/fs_dev.c b/src/firejail/fs_dev.c
index 09fb596d5..c1a7be9a8 100644
--- a/src/firejail/fs_dev.c
+++ b/src/firejail/fs_dev.c
@@ -141,16 +141,15 @@ errexit:
141} 141}
142 142
143static void create_link(const char *oldpath, const char *newpath) { 143static void create_link(const char *oldpath, const char *newpath) {
144 if (symlink(oldpath, newpath) == -1) 144 if (symlink(oldpath, newpath) == -1) {
145 goto errexit; 145 fprintf(stderr, "Error: cannot create %s device\n", newpath);
146 if (chown(newpath, 0, 0) < 0) 146 exit(1);
147 goto errexit; 147 }
148
149 if (chown(newpath, 0, 0) < 0);
150
148 fs_logger2("create", newpath); 151 fs_logger2("create", newpath);
149 return; 152 return;
150
151errexit:
152 fprintf(stderr, "Error: cannot create %s device\n", newpath);
153 exit(1);
154} 153}
155 154
156static void empty_dev_shm(void) { 155static void empty_dev_shm(void) {