diff options
-rw-r--r-- | src/bindfs.c | 67 | ||||
-rw-r--r-- | tests/odirect_write.c | 2 |
2 files changed, 1 insertions, 68 deletions
diff --git a/src/bindfs.c b/src/bindfs.c index 96f909b..bc24154 100644 --- a/src/bindfs.c +++ b/src/bindfs.c @@ -221,13 +221,6 @@ static int is_mirroring_enabled(); /* Checks whether the uid is to be the mirrored owner of all files. */ static int is_mirrored_user(uid_t uid); -#ifdef HAVE_FUSE_3 -#ifndef __NR_renameat2 -/* Returns the path to a temporary file inside the same directory as src_path */ -char *tmpnam_inpath(char *src_path); -#endif -#endif - /* Processes the virtual path to a real path. Always free() the result. */ static char *process_path(const char *path, bool resolve_symlinks); @@ -377,66 +370,6 @@ static int is_mirrored_user(uid_t uid) return 0; } -#ifdef HAVE_FUSE_3 -#ifndef __NR_renameat2 -char *tmpnam_inpath(char *src_path) -{ - - char *res, tmp[L_tmpnam], *path, *fname, *tfname, *src_path_cpy, *src_path_cpy_1, *tmp_cpy; - int i = 0; - - src_path_cpy = (char *) calloc((strlen(src_path)), sizeof(char)); - strcpy(src_path_cpy, src_path); - - src_path_cpy_1 = (char *) calloc((strlen(src_path)), sizeof(char)); - strcpy(src_path_cpy_1, src_path); - - path = dirname(src_path_cpy); - fname = basename(src_path_cpy_1); - - tmpnam(tmp); - tmp_cpy = (char *) calloc((strlen(tmp)), sizeof(char)); - strcpy(tmp_cpy, tmp); - - tfname = basename(tmp_cpy); - - res = (char *) calloc( (strlen(path) + 2 + strlen(tfname) + 1 + strlen(fname) + 1), sizeof(char)); - - strcat(res, path); - strcat(res, "/."); - strcat(res, tfname); - strcat(res, "~"); - strcat(res, fname); - - while (access( res, F_OK ) == 0 && i < 10) { - - tmpnam(tmp); - tmp_cpy = (char *) calloc((strlen(tmp)), sizeof(char)); - strcpy(tmp_cpy, tmp); - - tfname = basename(tmp_cpy); - - res = (char *) calloc( (strlen(path) + 2 + strlen(tfname) + 1 + strlen(fname) + 1), sizeof(char)); - - strcat(res, path); - strcat(res, "/."); - strcat(res, tfname); - strcat(res, "~"); - strcat(res, fname); - - i++; - } - - if (access( res, F_OK ) == 0) { - return NULL; - } - - return res; - -} -#endif -#endif - static char *process_path(const char *path, bool resolve_symlinks) { if (path == NULL) { /* possible? */ diff --git a/tests/odirect_write.c b/tests/odirect_write.c index 1376a51..10b63f9 100644 --- a/tests/odirect_write.c +++ b/tests/odirect_write.c @@ -57,7 +57,7 @@ int main(int argc, char** argv) { } if (res != buf_size) { // Too lazy to write a loop here unless it turns out to be necessary. - fprintf(stderr, "Failed to write exactly %ld bytes", amt_read); + fprintf(stderr, "Failed to write exactly %lu bytes", (unsigned long)amt_read); } } |