[Chilli] [PATCH] Binstatusfile not moved after chilliredir fork - Rev. 257
Alberto Bellettato
albesvs at yahoo.it
Tue Dec 15 18:44:35 UTC 2009
Sorry, too quick submitting the patch.. the code is NOT working fine
yet.
There is still a problem with [chill_redir] child staying linked to the
old config.bin directory.
If I have got time tomorrow I will dig the code..
> 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);
>
More information about the Chilli
mailing list