From fe8364707306c00fca9be80fb480908fc3f37e88 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 16 Mar 2005 17:07:32 +0000 Subject: * cygtls.cc (free_local): New macro. (_cygtls::remove): Use free_local to free known-malloced local variables. * cygtls.h: Mark some variables as "malloced". * net.cc (enum struct_type): Rename from is_* to t_* for clarity. (dump_protoent): Delete. (dup_ent): New macro. (__dup_ent): Renamed from dup_ent. Change arguments for convenience. Replace first argument with newly alloced value. Allocate a rounded number of bytes in an attempt to try to reuse space. Subsume "dump_protent". (cygwin_getprotobyname): Simplify using new dup_ent functionality. (cygwin_getprotobynumber): Ditto. (cygwin_getservbyname): Ditto. (cygwin_getservbyport): Ditto. (cygwin_gethostname): Ditto. (cygwin_gethostbyname): Ditto. * tlsoffsets.h: Regenerate. * syslog.cc (openlog): Use NULL rather than 0, for consistency with the rest of cygwin. (pass_handler::initialize): Use unbuffered I/O in pass one. --- winsup/cygwin/syslog.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/syslog.cc') diff --git a/winsup/cygwin/syslog.cc b/winsup/cygwin/syslog.cc index 62f606399..01b38fab3 100644 --- a/winsup/cygwin/syslog.cc +++ b/winsup/cygwin/syslog.cc @@ -50,12 +50,12 @@ openlog (const char *ident, int logopt, int facility) if (_my_tls.locals.process_ident != NULL) { free (_my_tls.locals.process_ident); - _my_tls.locals.process_ident = 0; + _my_tls.locals.process_ident = NULL; } if (ident) { _my_tls.locals.process_ident = (char *) malloc (strlen (ident) + 1); - if (_my_tls.locals.process_ident == NULL) + if (!_my_tls.locals.process_ident) { debug_printf ("failed to allocate memory for _my_tls.locals.process_ident"); return; @@ -138,6 +138,7 @@ pass_handler::initialize (int pass_number) return total_len_ + 1; fp_ = fopen ("/dev/null", "wb"); + setbuf (fp_, NULL); if (fp_ == NULL) { debug_printf ("failed to open /dev/null"); -- cgit v1.2.3