diff options
author | Jan Synacek <jsynacek@redhat.com> | 2014-01-08 15:01:37 +0100 |
---|---|---|
committer | Jan Synacek <jsynacek@redhat.com> | 2014-01-09 15:26:52 +0100 |
commit | 67d5db8908afbd40bf290ad9e771453cc099abc5 (patch) | |
tree | 0757f19adb8c8d2c87bf1d50f2b2c132b2a11be6 /src/logicalfile/LMI_UnixDirectoryProvider.c | |
parent | 787f13127b8679e1ef52646cab0940d370d5145c (diff) | |
download | openlmi-providers-67d5db8908afbd40bf290ad9e771453cc099abc5.tar.gz openlmi-providers-67d5db8908afbd40bf290ad9e771453cc099abc5.tar.xz openlmi-providers-67d5db8908afbd40bf290ad9e771453cc099abc5.zip |
logicalfile: replace thread-unsafe functions
Some functions, such as readdir() and dirname(), are not
thread-safe. Use equivalent glib functions.
trac: #173
Diffstat (limited to 'src/logicalfile/LMI_UnixDirectoryProvider.c')
-rw-r--r-- | src/logicalfile/LMI_UnixDirectoryProvider.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/logicalfile/LMI_UnixDirectoryProvider.c b/src/logicalfile/LMI_UnixDirectoryProvider.c index 0f5c69b..f6b0e24 100644 --- a/src/logicalfile/LMI_UnixDirectoryProvider.c +++ b/src/logicalfile/LMI_UnixDirectoryProvider.c @@ -93,8 +93,10 @@ static CMPIStatus LMI_UnixDirectoryCreateInstance( if (mkdir(path, 0777) < 0) { char errmsg[BUFLEN]; - char strerrmsg[STRERROR_BUF_LEN]; - snprintf(errmsg, BUFLEN, "Can't mkdir: %s (%s)", path, strerror_r(errno, strerrmsg, sizeof(strerrmsg))); + char strerr[BUFLEN]; + snprintf(errmsg, BUFLEN, "Can't mkdir: %s (%s)", + path, + strerror_r(errno, strerr, BUFLEN)); CMReturnWithChars(_cb, CMPI_RC_ERR_FAILED, errmsg); } @@ -122,8 +124,10 @@ static CMPIStatus LMI_UnixDirectoryDeleteInstance( if (rmdir(path) < 0) { char errmsg[BUFLEN]; - char strerrmsg[STRERROR_BUF_LEN]; - snprintf(errmsg, BUFLEN, "Can't rmdir: %s (%s)", path, strerror_r(errno, strerrmsg, sizeof(strerrmsg))); + char strerr[BUFLEN]; + snprintf(errmsg, BUFLEN, "Can't rmdir: %s (%s)", + path, + strerror_r(errno, strerr, BUFLEN)); CMReturnWithChars(_cb, CMPI_RC_ERR_FAILED, errmsg); } |