Diff

Differences From Artifact [0494c72e1d]:

To Artifact [b81dc3008d]:


    43     43   #ifndef APPFS_CACHEDIR
    44     44   #define APPFS_CACHEDIR "/var/cache/appfs"
    45     45   #endif
    46     46   
    47     47   /* Debugging macros */
    48     48   #ifdef DEBUG
    49     49   FILE *appfs_debug_fd = NULL;
           50  +
           51  +#ifndef APPFS_DEBUG_FD
           52  +#  ifdef APPFS_DEBUG_FILE
           53  +#    define APPFS_DEBUG_FD fopen(APPFS_DEBUG_FILE, "a")
           54  +#  else
           55  +#    define APPFS_DEBUG_FD fopen("/tmp/appfsd.log", "a")
           56  +#  endif
           57  +#endif
           58  +
    50     59   #define APPFS_DEBUG(x...) { \
    51     60   	char buf[8192]; \
    52     61   	int bufoff = 0; \
    53     62   	if (appfs_debug_fd == NULL) { \
    54         -		appfs_debug_fd = fopen("/tmp/appfsd.log", "a"); \
           63  +		appfs_debug_fd = APPFS_DEBUG_FD; \
    55     64   	}; \
    56     65   	if (appfs_debug_fd == NULL) { appfs_debug_fd = stderr; } \
    57     66   	bufoff = snprintf(buf, sizeof(buf), "[debug] [t=%llx] %s:%i:%s: ", (unsigned long long) pthread_self(), __FILE__, __LINE__, __func__); \
    58     67   	if (bufoff < sizeof(buf)) { \
    59     68   		bufoff += snprintf(buf + bufoff, sizeof(buf) - bufoff, x); \
    60     69   	}; \
    61     70   	if (bufoff < sizeof(buf)) { \
................................................................................
  2367   2376   
  2368   2377   	/*
  2369   2378   	 * Skip passed program name
  2370   2379   	 */
  2371   2380   	if (argc == 0 || argv == NULL) {
  2372   2381   		return(1);
  2373   2382   	}
         2383  +for (i = 0; i < argc; i++) {
         2384  +//	printf("argv[%i] = \"%s\"\n", i, argv[i]);
         2385  +}
  2374   2386   
  2375   2387   	argv0 = argv[0];
  2376   2388   
  2377   2389   	argc--;
  2378   2390   	argv++;
  2379   2391   
  2380   2392   	/*