[Chilli] [PATCH] Binstatusfile not moved after chilliredir fork - Rev. 257

David Bird david at coova.com
Tue Dec 15 18:36:50 UTC 2009


And this will be erv 259, thnks@

On Tue, 2009-12-15 at 19:13 +0100, Alberto Bellettato wrote:
> In rev. 257 there is a problem with the binstatusfile, that issues a message in the log files "(Directory not empty) /tmp/chilli-xxxxx".
> 
> That is caused by the rename(file,file2) not working (not moving the bin file) because file = file2 = file with old PID.
> Infact file2 is set by chilli_binconfig(), that used the "bc = _options.binconfig" value (set to the old PID).
> 
> I think the /tmp/chilli-xxxxx dir should be clean when chilli stop too, but it is not a priority since it uses only 16 bytes.
> 
> Here is the patch.
> 
> Index: src/chilli.c
> ===================================================================
> --- src/chilli.c        (revisione 257)
> +++ src/chilli.c        (copia locale)
> @@ -4170,9 +4170,9 @@
>         log_err(errno, file2);
> 
>        chilli_binconfig(file, sizeof(file), cpid);
> -      chilli_binconfig(file2, sizeof(file2), getpid());
> +      snprintf(file2, sizeof(file2), "/tmp/chilli-%d/config.bin", getpid());
> 
> -      rename(file, file2);
> +      if (rename(file, file2)) log_err(errno, file);
> 
>        umask(process_mask);
> 
> 
> _______________________________________________
> Chilli mailing list
> Chilli at coova.org
> http://lists.coova.org/cgi-bin/mailman/listinfo/chilli




More information about the Chilli mailing list