Skip to content

Commit d268f8f

Browse files
committed
Improve error message if driver installed in the container
Fixes: #13
1 parent 3fdac29 commit d268f8f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,11 @@ file_create(struct error *err, const char *path, const char *data, uid_t uid, gi
521521
size = strlen(data);
522522
flags |= O_WRONLY|O_TRUNC;
523523
}
524-
if ((fd = open(path, flags, perm)) < 0)
524+
if ((fd = open(path, flags, perm)) < 0) {
525+
if (errno == ELOOP)
526+
errno = EEXIST; /* XXX Better error message if the file exists and is a symlink. */
525527
goto fail;
528+
}
526529
if (data != NULL && write(fd, data, size) < (ssize_t)size) {
527530
close(fd);
528531
goto fail;

0 commit comments

Comments
 (0)