Author: grothoff Date: 2008-02-17 23:11:37 -0700 (Sun, 17 Feb 2008) New Revision: 6366
Modified: GNUnet/src/applications/fs/tools/gnunet-auto-share.c Log: fixing dirname in daemonize mode (chdir issue) Modified: GNUnet/src/applications/fs/tools/gnunet-auto-share.c =================================================================== --- GNUnet/src/applications/fs/tools/gnunet-auto-share.c 2008-02-18 06:07:21 UTC (rev 6365) +++ GNUnet/src/applications/fs/tools/gnunet-auto-share.c 2008-02-18 06:11:37 UTC (rev 6366) @@ -333,9 +333,8 @@ * @return return 0 for ok, -1 on error */ int -auto_share_main (const char *argvi) +auto_share_main (const char *dirname) { - char *dirname; int errorCode; unsigned long long verbose; GNUNET_CronTime delay; @@ -346,8 +345,7 @@ errorCode = 0; if ((GNUNET_NO == debug_flag) && (GNUNET_OK != GNUNET_terminal_detach (ectx, cfg, filedes))) - return GNUNET_SYSERR; - + return GNUNET_SYSERR; sock = GNUNET_client_connection_create (ectx, cfg); if (sock == NULL) { @@ -357,7 +355,6 @@ GNUNET_terminal_detach_complete (ectx, filedes, GNUNET_NO); goto quit; } - dirname = GNUNET_expand_file_name (ectx, argvi); GNUNET_GC_get_configuration_value_number (cfg, "GNUNET", "VERBOSE", 0, 9999, 0, &verbose); @@ -403,7 +400,6 @@ GNUNET_FSUI_stop (ctx); if (gloKeywords != NULL) GNUNET_ECRS_uri_destroy (gloKeywords); - GNUNET_free (dirname); quit: while (records != NULL) { @@ -444,6 +440,7 @@ int i; int errorCode; char *log_file_name; + char *dirname; errorCode = 0; i = GNUNET_init (argc, @@ -516,7 +513,11 @@ } else #endif - errorCode = auto_share_main (argv[i]); + { + dirname = GNUNET_expand_file_name (ectx, argv[i]); + errorCode = auto_share_main (dirname); + GNUNET_free(dirname); + } end: GNUNET_fini (ectx, cfg); return errorCode; _______________________________________________ GNUnet-SVN mailing list GNUnet-SVN@gnu.org http://lists.gnu.org/mailman/listinfo/gnunet-svn