Author: aschnell Date: Fri May 11 15:28:35 2012 New Revision: 68147 URL: http://svn.opensuse.org/viewcvs/yast?rev=68147&view=rev Log: - fixed use of strerror_r (GNU version) Modified: trunk/core/liby2util-r/src/y2log.cc Modified: trunk/core/liby2util-r/src/y2log.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/liby2util-r/src/y2log.cc?rev=68147&r1=68146&r2=68147&view=diff ============================================================================== --- trunk/core/liby2util-r/src/y2log.cc (original) +++ trunk/core/liby2util-r/src/y2log.cc Fri May 11 15:28:35 2012 @@ -119,10 +119,10 @@ FILE * newstderr = fdopen( dupstderr, "a" ); if ( newstderr == NULL ) { - char buf[100]; + char buf1[100]; //bnc#493152#c22 - strerror_r(errno, buf, sizeof(buf)-1); - fprintf( Y2LOG_STDERR, "y2log: Can't fdopen new stderr: %s.\n", buf); + const char* buf2 = strerror_r(errno, buf1, sizeof(buf1)-1); + fprintf(Y2LOG_STDERR, "y2log: Can't fdopen new stderr: %s.\n", buf2); } else { fcntl (fileno (newstderr), F_SETFD, fcntl (fileno (newstderr), F_GETFD) | FD_CLOEXEC); @@ -130,9 +130,9 @@ } } else { - char buf[100]; - strerror_r(errno, buf, sizeof(buf)-1); - fprintf( Y2LOG_STDERR, "y2log: Can't dup stderr: %s.\n", buf ); + char buf1[100]; + const char* buf2 = strerror_r(errno, buf1, sizeof(buf1)-1); + fprintf(Y2LOG_STDERR, "y2log: Can't dup stderr: %s.\n", buf2); } return 1; } @@ -150,10 +150,10 @@ logfile = fopen (logname, "a"); } if (!logfile && !log_simple) { - char buf[100]; - strerror_r(errno, buf, sizeof(buf)-1); - fprintf (Y2LOG_STDERR, "y2log: Error opening logfile '%s': %s.\n", - logname, buf); + char buf1[100]; + const char* buf2 = strerror_r(errno, buf1, sizeof(buf1)-1); + fprintf(Y2LOG_STDERR, "y2log: Error opening logfile '%s': %s.\n", + logname, buf2); return NULL; } } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org