components/openscap/patches/common-debug.c.patch
changeset 6295 5bc187901764
equal deleted inserted replaced
6294:ff05e37b1eac 6295:5bc187901764
       
     1 --- openscap-1.2.9/src/common/debug.c.~1~	2016-04-21 04:51:58.321492428 -0700
       
     2 +++ openscap-1.2.9/src/common/debug.c	2016-06-08 13:17:18.681401563 -0700
       
     3 @@ -30,7 +30,10 @@
       
     4  # include <string.h>
       
     5  # include <stdlib.h>
       
     6  # include <sys/types.h>
       
     7 +# include <sys/fcntl.h>
       
     8 +# include <sys/stat.h>
       
     9  # include <sys/file.h>
       
    10 +# include <fcntl.h>
       
    11  # include <unistd.h>
       
    12  # include <time.h>
       
    13  # include <errno.h>
       
    14 @@ -169,7 +172,11 @@
       
    15  	default:
       
    16  		l = '0';
       
    17  	}
       
    18 +#if !defined(__SVR4) && !defined (__sun)
       
    19  	fprintf(__debuglog_fp, "%c: %s: ", l, program_invocation_short_name);
       
    20 +#else
       
    21 +	fprintf(__debuglog_fp, "%c: %ld: ", l, (long) getpid());
       
    22 +#endif
       
    23  	for (int i = 0; i < indent; i++) {
       
    24  		fprintf(__debuglog_fp, "  ");
       
    25  	}
       
    26 @@ -186,6 +193,7 @@
       
    27  #else
       
    28  	snprintf(thread_name, THREAD_NAME_LEN, "unknown");
       
    29  #endif
       
    30 +#if !defined(__SVR4) && !defined (__sun)
       
    31  	/* XXX: non-portable usage of pthread_t */
       
    32  	fprintf(__debuglog_fp, " [%s(%ld):%s(%llx):%s:%zu:%s]",
       
    33  		program_invocation_short_name, (long) getpid(), thread_name,
       
    34 @@ -193,6 +201,10 @@
       
    35  #else
       
    36  	fprintf(__debuglog_fp, " [%ld:%s:%zu:%s]", (long) getpid(),
       
    37  		f, line, fn);
       
    38 +#endif
       
    39 +#else
       
    40 +	fprintf(__debuglog_fp, " [%ld:%s:%zu:%s]", (long) getpid(),
       
    41 +		f, line, fn);
       
    42  #endif
       
    43  }
       
    44