Re: Blocking on IO ...
- From: Havoc Pennington <hp redhat com>
- To: Michael Meeks <michael ximian com>
- Cc: <gconf-list gnome org>
- Subject: Re: Blocking on IO ...
- Date: 14 Aug 2001 01:05:41 -0400
Michael Meeks <michael ximian com> writes:
> + g_assert (chdir ("/") == 0);
This should come out of the assert, or it breaks if you
G_DISABLE_ASSERT. (Also as a matter of code clarity, I always assume
assertions don't contain important functionality.)
If it was worth it to check this error (and I don't think it really
is), I would write:
if (chdir ("/") < 0)
{
fprintf (stderr, "Could not change to root directory: %s\n",
g_strerror (errno));
exit (1);
}
> +
> + dev_null_fd = open ("/dev/null", O_RDWR);
> + if (dev_null_fd >= 0) {
> + dup2 (dev_null_fd, 0);
> + dup2 (dev_null_fd, 1);
> + dup2 (dev_null_fd, 2);
> + }
>
Looks good, let's do this.
> Of course - ideally we'd have an environment variable to let it
> all spew to the console where it can be easily caught - is that
> interesting ?
Not for gconf's spew, which never goes to stdout/stderr (g_warning()
etc. are even redirected to syslog IIRC), but perhaps if you want
other module's spew redirected. I don't have any objection to a patch
doing that.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]