Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-08-25 01:19:14 +0400
committerChristopher Faylor <me@cgf.cx>2000-08-25 01:19:14 +0400
commita3cfd73ac9146404bc5fc4f44a832aa99749211c (patch)
tree23aa6449d1a1529dac1737fec41d865ed13160b4 /winsup/cygwin/syslog.cc
parentbe8924c43b66349bdf7d760fc73d779db6f0bcee (diff)
* select.cc (cygwin_select): Correct logic for "always_ready" fds or when there
is no wait specified. * syslog.cc (pass_handler::set_message): Zero the buffer prior to setting it.
Diffstat (limited to 'winsup/cygwin/syslog.cc')
-rw-r--r--winsup/cygwin/syslog.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/winsup/cygwin/syslog.cc b/winsup/cygwin/syslog.cc
index 48b0d6683..233c8916e 100644
--- a/winsup/cygwin/syslog.cc
+++ b/winsup/cygwin/syslog.cc
@@ -71,7 +71,7 @@ openlog (const char *ident, int logopt, int facility)
if (ident)
{
process_ident = (char *) malloc (strlen (ident) + 1);
- if (process_ident == 0)
+ if (process_ident == NULL)
{
debug_printf ("failed to allocate memory for process_ident");
return;
@@ -126,7 +126,7 @@ class pass_handler
int print (const char *,...);
int print_va (const char *, va_list);
char *get_message () const { return message_; }
- void set_message (char *s) { message_ = s; }
+ void set_message (char *s) { message_ = s; *message_ = '\0'; }
};
pass_handler::pass_handler () : fp_ (0), message_ (0), total_len_ (0)
@@ -179,7 +179,7 @@ pass_handler::print (const char *fmt, ...)
int
pass_handler::print_va (const char *fmt, va_list list)
{
- if (fp_ != 0)
+ if (fp_ != NULL)
{
int len = vfprintf (fp_, fmt, list);
if (len < 0)
@@ -187,7 +187,7 @@ pass_handler::print_va (const char *fmt, va_list list)
total_len_ += len;
return 0;
}
- else if (message_ != 0)
+ else if (message_ != NULL)
{
char *printpos = &message_[strlen (message_)];
vsprintf (printpos, fmt, list);
@@ -289,7 +289,7 @@ syslog (int priority, const char *message, ...)
pass.set_message ((char *) alloca (n));
/* Deal with ident_string */
- if (process_ident != 0)
+ if (process_ident != NULL)
{
if (pass.print ("%s : ", process_ident) == -1)
return;
@@ -340,9 +340,9 @@ syslog (int priority, const char *message, ...)
if (os_being_run == winNT)
{
/* For NT, open the event log and send the message */
- HANDLE hEventSrc = RegisterEventSourceA (NULL, (process_ident != 0) ?
+ HANDLE hEventSrc = RegisterEventSourceA (NULL, (process_ident != NULL) ?
process_ident : CYGWIN_LOG_NAME);
- if (hEventSrc == 0)
+ if (hEventSrc == NULL)
{
debug_printf ("RegisterEventSourceA failed with %E");
return;
@@ -355,7 +355,7 @@ syslog (int priority, const char *message, ...)
{
/* Under Windows 95, append the message to the log file */
FILE *fp = fopen (get_win95_event_log_path (), "a");
- if (fp == 0)
+ if (fp == NULL)
{
debug_printf ("failed to open file %s",
get_win95_event_log_path ());