diff options
author | Simon Rettberg | 2015-12-12 14:29:44 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-12-12 14:29:44 +0100 |
commit | b423733b2614946d2a7cf80ee877f4ad5ca11c64 (patch) | |
tree | 05d0267632db3b71bee30ba044c8602b7ec82496 /src/server/fileutil.c | |
parent | [SERVER] Nullpad images virtually at runtime instead of padding the actual file (diff) | |
download | dnbd3-b423733b2614946d2a7cf80ee877f4ad5ca11c64.tar.gz dnbd3-b423733b2614946d2a7cf80ee877f4ad5ca11c64.tar.xz dnbd3-b423733b2614946d2a7cf80ee877f4ad5ca11c64.zip |
[SERVER] Support looking on disk if an unknown image is requested
Diffstat (limited to 'src/server/fileutil.c')
-rw-r--r-- | src/server/fileutil.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/fileutil.c b/src/server/fileutil.c index 645519b..4aaced4 100644 --- a/src/server/fileutil.c +++ b/src/server/fileutil.c @@ -3,6 +3,7 @@ #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> +#include <stdio.h> #include <sys/statvfs.h> #include <errno.h> #include <stdlib.h> @@ -27,7 +28,7 @@ bool file_isWritable(char *file) fd = open( file, O_WRONLY | O_CREAT, 0600 ); if ( fd < 0 ) return false; close( fd ); - unlink( file ); + remove( file ); return true; } |