diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-03-02 19:05:53 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-03-02 19:05:53 +0000 |
commit | 17955c9f953051ca4bcccdbe42864573eac5400a (patch) | |
tree | 30029b309a84bd4e94085727825b9afffb943856 | |
parent | 33eb2e75a1bcf47eb2e2513fd9d912e0911af486 (diff) | |
download | gnunet-17955c9f953051ca4bcccdbe42864573eac5400a.tar.gz gnunet-17955c9f953051ca4bcccdbe42864573eac5400a.zip |
- LRN: Use RENAME() instead of 'mv'
-rw-r--r-- | src/testing/testing_group.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index 2d0e9ef79..feb372c40 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -2927,15 +2927,12 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg) | |||
2927 | if (pg->peers[pg_iter].daemon->hostname == NULL) /* Local, just copy the file */ | 2927 | if (pg->peers[pg_iter].daemon->hostname == NULL) /* Local, just copy the file */ |
2928 | { | 2928 | { |
2929 | GNUNET_asprintf (&arg, "%s/friends", temp_service_path); | 2929 | GNUNET_asprintf (&arg, "%s/friends", temp_service_path); |
2930 | procarr[pg_iter] = | ||
2931 | GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "mv", "mv", mytemp, arg, NULL); | ||
2932 | GNUNET_assert (procarr[pg_iter] != NULL); | ||
2933 | #if VERBOSE_TESTING | 2930 | #if VERBOSE_TESTING |
2934 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2931 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2935 | "Copying file with command cp %s %s\n", mytemp, arg); | 2932 | "Copying file with RENAME(%s,%s)\n", mytemp, arg); |
2936 | #endif | 2933 | #endif |
2937 | ret = GNUNET_OS_process_wait (procarr[pg_iter]); /* FIXME: schedule this, throttle! */ | 2934 | RENAME (mytemp, arg); |
2938 | GNUNET_OS_process_close (procarr[pg_iter]); | 2935 | procarr[pg_iter] = NULL; |
2939 | GNUNET_free (arg); | 2936 | GNUNET_free (arg); |
2940 | } | 2937 | } |
2941 | else /* Remote, scp the file to the correct place */ | 2938 | else /* Remote, scp the file to the correct place */ |
@@ -3126,11 +3123,11 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg, | |||
3126 | if (pg->peers[pg_iter].daemon->hostname == NULL) /* Local, just copy the file */ | 3123 | if (pg->peers[pg_iter].daemon->hostname == NULL) /* Local, just copy the file */ |
3127 | { | 3124 | { |
3128 | GNUNET_asprintf (&arg, "%s/blacklist", temp_service_path); | 3125 | GNUNET_asprintf (&arg, "%s/blacklist", temp_service_path); |
3129 | procarr[pg_iter] = | 3126 | RENAME (mytemp, arg); |
3130 | GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "mv", "mv", mytemp, arg, NULL); | 3127 | procarr[pg_iter] = NULL; |
3131 | #if VERBOSE_TESTING | 3128 | #if VERBOSE_TESTING |
3132 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3129 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3133 | _("Copying file with command cp %s %s\n"), mytemp, arg); | 3130 | _("Copying file with RENAME (%s,%s)\n"), mytemp, arg); |
3134 | #endif | 3131 | #endif |
3135 | 3132 | ||
3136 | GNUNET_free (arg); | 3133 | GNUNET_free (arg); |