diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2014-01-09 15:15:53 +0100 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2014-01-09 15:15:53 +0100 |
commit | d1660672c0ba88e75b27af85449a0d39abed8408 (patch) | |
tree | b17318153a396f0af5108bdc2343c9cbc5af46ed /src/account | |
parent | bc16e11fb41146aee30f851bd41de9d645ad68bb (diff) | |
download | openlmi-providers-d1660672c0ba88e75b27af85449a0d39abed8408.tar.gz openlmi-providers-d1660672c0ba88e75b27af85449a0d39abed8408.tar.xz openlmi-providers-d1660672c0ba88e75b27af85449a0d39abed8408.zip |
Use re-entrant version of strerror() for thread safety
Diffstat (limited to 'src/account')
-rw-r--r-- | src/account/indication_common.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/account/indication_common.c b/src/account/indication_common.c index f5caa75..648a20f 100644 --- a/src/account/indication_common.c +++ b/src/account/indication_common.c @@ -105,6 +105,7 @@ bool watcher(AccountIndication *ind, void **data) { struct timespec curr_pwd, curr_grp; char buffer[BUF_LEN]; + char errbuf[STRERROR_BUF_LEN]; if (ind->inotify_fd < 0) return false; @@ -112,7 +113,7 @@ bool watcher(AccountIndication *ind, void **data) do { int len = 0, i = 0; if ((len = read(ind->inotify_fd, buffer, BUF_LEN)) < 0 || len > (int) BUF_LEN) { - warn("account watcher: error reading from inotify fd: %s", strerror(errno)); + warn("account watcher: error reading from inotify fd: %s", strerror_r(errno, errbuf, sizeof(errbuf))); watcher_destroy(ind); watcher_init(ind); return false; |