Changeset 13969
- Timestamp:
- Feb 4, 2013, 9:45:20 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/daemon.c
r13868 r13969 278 278 { 279 279 tr_logAddInfo ("Deleting input .torrent file \"%s\"", file); 280 if ( remove (filename))280 if (tr_remove (filename)) 281 281 tr_logAddError ("Error deleting .torrent file: %s", tr_strerror (errno)); 282 282 } … … 284 284 { 285 285 char * new_filename = tr_strdup_printf ("%s.added", filename); 286 rename (filename, new_filename);286 tr_rename (filename, new_filename); 287 287 tr_free (new_filename); 288 288 } … … 598 598 /* cleanup */ 599 599 if (pidfile_created) 600 remove (pid_filename);600 tr_remove (pid_filename); 601 601 tr_variantFree (&settings); 602 602 return 0; -
trunk/libtransmission/blocklist-test.c
r13916 r13969 34 34 tr_free (dir); 35 35 36 remove (path);36 tr_remove (path); 37 37 fp = fopen (path, "w+"); 38 38 fprintf (fp, "%s", contents); -
trunk/libtransmission/libtransmission-test.c
r13916 r13969 167 167 fprintf (stderr, "cleanup: removing %s\n", killme); 168 168 169 remove (killme);169 tr_remove (killme); 170 170 } 171 171 } -
trunk/libtransmission/platform.c
r13868 r13969 372 372 char * o = tr_buildPath (oldDir, name, NULL); 373 373 char * n = tr_buildPath (newDir, name, NULL); 374 rename (o, n);374 tr_rename (o, n); 375 375 ++count; 376 376 tr_free (n); -
trunk/libtransmission/rename-test.c
r13916 r13969 1 1 #include <assert.h> 2 2 #include <errno.h> 3 #include <stdio.h> /* remove() */3 #include <stdio.h> /* fopen() */ 4 4 #include <string.h> /* strcmp() */ 5 5 #include <stdio.h> … … 99 99 tr_free (dir); 100 100 101 remove (path);101 tr_remove (path); 102 102 fp = fopen (path, "wb"); 103 103 fprintf (fp, "%s", str); … … 399 399 str = tr_torrentFindFile (tor, 1); 400 400 check (str != NULL); 401 remove (str);401 tr_remove (str); 402 402 tr_free (str); 403 403 str = tr_torrentFindFile (tor, 2); 404 404 check (str != NULL); 405 remove (str);405 tr_remove (str); 406 406 tmp = tr_dirname (str); 407 remove (tmp);407 tr_remove (tmp); 408 408 tr_free (tmp); 409 409 tr_free (str); -
trunk/libtransmission/session.c
r13933 r13969 2239 2239 2240 2240 old = tr_strdup_printf ("%s.old", binname); 2241 remove (old);2242 rename (binname, old);2241 tr_remove (old); 2242 tr_rename (binname, old); 2243 2243 b = tr_blocklistFileNew (binname, isEnabled); 2244 2244 if (tr_blocklistFileSetContent (b, path) > 0) 2245 2245 { 2246 remove (old);2246 tr_remove (old); 2247 2247 } 2248 2248 else 2249 2249 { 2250 remove (binname);2251 rename (old, binname);2250 tr_remove (binname); 2251 tr_rename (old, binname); 2252 2252 } 2253 2253 -
trunk/libtransmission/torrent-magnet.c
r13959 r13969 12 12 13 13 #include <assert.h> 14 #include <stdio.h> /* remove () */15 14 #include <string.h> /* memcpy (), memset (), memcmp () */ 16 15 … … 264 263 265 264 /* remove any old .torrent and .resume files */ 266 remove (path);265 tr_remove (path); 267 266 tr_torrentRemoveResume (tor); 268 267 -
trunk/libtransmission/torrent.c
r13933 r13969 28 28 #include <string.h> /* memcmp */ 29 29 #include <stdlib.h> /* qsort */ 30 #include <stdio.h> /* remove () */31 30 32 31 #include <event2/util.h> /* evutil_vsnprintf () */ … … 2776 2775 removeEmptyFoldersAndJunkFiles (filename); 2777 2776 else if (isJunkFile (d->d_name)) 2778 remove (filename);2777 tr_remove (filename); 2779 2778 tr_free (filename); 2780 2779 } 2781 2780 } 2782 remove (folder);2781 tr_remove (folder); 2783 2782 closedir (odir); 2784 2783 } … … 3107 3106 char * newpath = tr_buildPath (base, f->name, NULL); 3108 3107 3109 if ( rename (oldpath, newpath))3108 if (tr_rename (oldpath, newpath)) 3110 3109 tr_logAddTorErr (tor, "Error moving \"%s\" to \"%s\": %s", oldpath, newpath, tr_strerror (errno)); 3111 3110 … … 3525 3524 3526 3525 tmp = errno; 3527 rv = rename (src, tgt);3526 rv = tr_rename (src, tgt); 3528 3527 if (rv != 0) 3529 3528 error = errno; -
trunk/libtransmission/utils.c
r13967 r13969 1438 1438 /* they might be on the same filesystem... */ 1439 1439 { 1440 const int i = rename (oldpath, newpath);1440 const int i = tr_rename (oldpath, newpath); 1441 1441 if (renamed != NULL) 1442 1442 *renamed = i == 0; … … 1471 1471 unlink (oldpath); 1472 1472 return 0; 1473 } 1474 1475 int 1476 tr_rename (const char * oldpath, const char * newpath) 1477 { 1478 /* FIXME: needs win32 utf-16 support */ 1479 1480 return rename (oldpath, newpath); 1481 } 1482 1483 int 1484 tr_remove (const char * pathname) 1485 { 1486 /* FIXME: needs win32 utf-16 support */ 1487 1488 return remove (pathname); 1473 1489 } 1474 1490 -
trunk/libtransmission/utils.h
r13868 r13969 391 391 bool * renamed) TR_GNUC_NONNULL (1,2); 392 392 393 /** @brief Portability wrapper for rename () */ 394 int tr_rename (const char * oldpath_utf8, const char * newpath_utf8); 395 396 /** @brief Portability wrapper for remove () */ 397 int tr_remove (const char * pathname_utf8); 398 393 399 /** @brief Test to see if the two filenames point to the same file. */ 394 400 bool tr_is_same_file (const char * filename1, const char * filename2); -
trunk/libtransmission/variant.c
r13968 r13969 1213 1213 tr_close_file (fd); 1214 1214 1215 #ifdef WIN32 1216 if (MoveFileEx (tmp, filename, MOVEFILE_REPLACE_EXISTING)) 1217 #else 1218 if (!rename (tmp, filename)) 1219 #endif 1215 if (!tr_rename (tmp, filename)) 1220 1216 { 1221 1217 tr_logAddInfo (_("Saved \"%s\""), filename);
Note: See TracChangeset
for help on using the changeset viewer.