From: Arvin Schnell Date: Wed, 5 Dec 2018 09:10:01 +0000 (+0100) Subject: - fixed stringerror function X-Git-Tag: v0.8.2~5^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=eea6ddef5376371f750ea0c16dbdb118687e82fc;p=thirdparty%2Fsnapper.git - fixed stringerror function --- diff --git a/snapper/AppUtil.cc b/snapper/AppUtil.cc index 1d8fb967..553065cd 100644 --- a/snapper/AppUtil.cc +++ b/snapper/AppUtil.cc @@ -223,14 +223,14 @@ namespace snapper string stringerror(int errnum) { -#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE +#if (_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE char buf1[100]; - if (strerror_r(errno, buf1, sizeof(buf1)-1) == 0) + if (strerror_r(errnum, buf1, sizeof(buf1) - 1) == 0) return string(buf1); return string("strerror failed"); #else char buf1[100]; - const char* buf2 = strerror_r(errno, buf1, sizeof(buf1)-1); + const char* buf2 = strerror_r(errnum, buf1, sizeof(buf1) - 1); return string(buf2); #endif }