Misc. cleanups.

* daemon.h:
* gnuserv.c: (syslog_message), (syslog_io_message):
* main.c: (handle_parent_connection):
* slave.c: (handle_slave_connection), (handle_slave_command): Misc. cleanups.
This commit is contained in:
Benoît Dejean
2005-02-15 10:35:44 +00:00
parent 0fdfd65a2a
commit b43e879cc0
5 changed files with 24 additions and 19 deletions

View File

@@ -1,3 +1,10 @@
2005-02-15 Benoît Dejean <TazForEver@dlfp.org>
* daemon.h:
* gnuserv.c: (syslog_message), (syslog_io_message):
* main.c: (handle_parent_connection):
* slave.c: (handle_slave_connection), (handle_slave_command): Misc. cleanups.
2004-09-19 Benoît Dejean <tazforever@dlfp.org> 2004-09-19 Benoît Dejean <tazforever@dlfp.org>
* gnuserv.c: (setup_table): 'screen' is only defined when AUTH_MAGIC_COOKIE * gnuserv.c: (setup_table): 'screen' is only defined when AUTH_MAGIC_COOKIE

View File

@@ -60,17 +60,17 @@ G_BEGIN_DECLS
#define MSG_BUFSZ sizeof (struct _glibtop_ipc_message) #define MSG_BUFSZ sizeof (struct _glibtop_ipc_message)
#define MSG_MSGSZ (MSG_BUFSZ - sizeof (long)) #define MSG_MSGSZ (MSG_BUFSZ - sizeof (long))
void handle_parent_connection (int s); void handle_parent_connection (int s) G_GNUC_INTERNAL;
void handle_slave_connection (int input, int output); void handle_slave_connection (int input, int output) G_GNUC_INTERNAL;
void handle_slave_command (glibtop_command *cmnd, glibtop_response *resp, void handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
const void *parameter); const void *parameter) G_GNUC_INTERNAL ;
void do_output (int s, glibtop_response *resp, off_t offset, void do_output (int s, glibtop_response *resp, off_t offset,
size_t data_size, const void *data); size_t data_size, const void *data) G_GNUC_INTERNAL;
int do_read (int s, void *ptr, size_t total_size); int do_read (int s, void *ptr, size_t total_size) G_GNUC_INTERNAL;
void syslog_message (int priority, char *format, ...); void syslog_message (int priority, const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(2, 3);
void syslog_io_message (int priority, char *format, ...); void syslog_io_message (int priority, const char *format, ...) G_GNUC_INTERNAL G_GNUC_PRINTF(2, 3);
extern int enable_debug; extern int enable_debug;
extern int verbose_output; extern int verbose_output;

View File

@@ -65,8 +65,6 @@ char *program_invocation_short_name;
char *program_invocation_name; char *program_invocation_name;
#endif #endif
void handle_parent_connection (int s);
void handle_slave_connection (int input, int output);
#if !defined(INTERNET_DOMAIN_SOCKETS) #if !defined(INTERNET_DOMAIN_SOCKETS)
#error "Internet Domain sockets are required" #error "Internet Domain sockets are required"
@@ -87,7 +85,7 @@ static int invoked_from_inetd = 0;
static int changed_uid = 0; static int changed_uid = 0;
void void
syslog_message (int priority, char *format, ...) syslog_message (int priority, const char *format, ...)
{ {
va_list ap; va_list ap;
char buffer [BUFSIZ]; char buffer [BUFSIZ];
@@ -100,7 +98,7 @@ syslog_message (int priority, char *format, ...)
} }
void void
syslog_io_message (int priority, char *format, ...) syslog_io_message (int priority, const char *format, ...)
{ {
va_list ap; va_list ap;
char buffer [BUFSIZ]; char buffer [BUFSIZ];

View File

@@ -67,8 +67,8 @@ handle_parent_connection (int s)
if (cmnd->data_size >= BUFSIZ) { if (cmnd->data_size >= BUFSIZ) {
syslog_message (LOG_WARNING, syslog_message (LOG_WARNING,
"Client sent %d bytes, but buffer is %d", "Client sent %d bytes, but buffer is %lu",
cmnd->data_size, BUFSIZ); (int)cmnd->data_size, (unsigned long)BUFSIZ);
return; return;
} }
@@ -229,8 +229,8 @@ handle_parent_connection (int s)
0, NULL); 0, NULL);
break; break;
default: default:
syslog_message (LOG_ERR, "Parent received unknown command %u.", syslog_message (LOG_ERR, "Parent received unknown command %d.",
cmnd->command); (int)cmnd->command);
break; break;
} }
} }

View File

@@ -47,8 +47,8 @@ handle_slave_connection (int input, int output)
if (cmnd->data_size >= BUFSIZ) if (cmnd->data_size >= BUFSIZ)
glibtop_error ("Client sent %d bytes, " glibtop_error ("Client sent %d bytes, "
"but buffer is %d", "but buffer is %lu",
cmnd->size, BUFSIZ); cmnd->size, (unsigned long)BUFSIZ);
memset (resp, 0, sizeof (glibtop_response)); memset (resp, 0, sizeof (glibtop_response));
@@ -249,7 +249,7 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
break; break;
#endif #endif
default: default:
glibtop_error ("Child received unknown command %u", glibtop_error ("Child received unknown command %d",
cmnd->command); cmnd->command);
break; break;
} }