From 9362aac398e3f2ec680e30c61ebfcb1e407eff72 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 12 Mar 2007 22:52:40 +0000 Subject: 2007-03-11 Havoc Pennington * tools/dbus-launch.c (do_close_stderr): fix C89 problem and formatting problem * Mostly fix the DBusPipe mess. - put line break after function return types - put space before parens - do not pass structs around by value - don't use dbus_strerror after calling supposedly cross-platform api - don't name pipe variables "fd" - abstract special fd numbers like -1 and 1 --- tools/dbus-launch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools/dbus-launch.c') diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c index d3072782..569a3ca6 100644 --- a/tools/dbus-launch.c +++ b/tools/dbus-launch.c @@ -596,14 +596,17 @@ babysit (int exit_with_session, exit (0); } -static void do_close_stderr (void) +static void +do_close_stderr (void) { + int fd; + fflush (stderr); /* dbus-launch is a Unix-only program, so we can rely on /dev/null being there. * We're including unistd.h and we're dealing with sh/csh launch sequences... */ - int fd = open ("/dev/null", O_RDWR); + fd = open ("/dev/null", O_RDWR); if (fd == -1) { fprintf (stderr, "Internal error: cannot open /dev/null: %s", strerror (errno)); -- cgit