summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2009-11-05 18:40:06 (GMT)
committerZach Mullen <zach.mullen@kitware.com>2009-11-05 18:40:06 (GMT)
commit5a6cb44e96480cb6de4d3790608f1afc952d6b18 (patch)
treebf6f3424bcc3f99b237981d6479a4cb60e95b3b8 /Utilities
parentdc577fb8b1379644c18e650b5904841946c47f4b (diff)
downloadCMake-5a6cb44e96480cb6de4d3790608f1afc952d6b18.zip
CMake-5a6cb44e96480cb6de4d3790608f1afc952d6b18.tar.gz
CMake-5a6cb44e96480cb6de4d3790608f1afc952d6b18.tar.bz2
Fixed a few of the SunOS build errors in libarchive.
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_disk_set_standard_lookup.c12
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_disk_set_standard_lookup.c12
2 files changed, 20 insertions, 4 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_disk_set_standard_lookup.c b/Utilities/cmlibarchive/libarchive/archive_read_disk_set_standard_lookup.c
index fc4e9f2..dca7c2b 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_disk_set_standard_lookup.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_disk_set_standard_lookup.c
@@ -186,7 +186,7 @@ static const char *
lookup_uname_helper(struct name_cache *cache, id_t id)
{
struct passwd pwent, *result;
- int r;
+ int r = 0;
if (cache->buff_size == 0) {
cache->buff_size = 256;
@@ -195,8 +195,12 @@ lookup_uname_helper(struct name_cache *cache, id_t id)
if (cache->buff == NULL)
return (NULL);
for (;;) {
+#if defined(__sun)
+ result = getpwuid_r((uid_t)id, &pwent, cache->buff, cache->buff_size);
+#else
r = getpwuid_r((uid_t)id, &pwent,
cache->buff, cache->buff_size, &result);
+#endif
if (r == 0)
break;
if (r != ERANGE)
@@ -234,7 +238,7 @@ static const char *
lookup_gname_helper(struct name_cache *cache, id_t id)
{
struct group grent, *result;
- int r;
+ int r = 0;
if (cache->buff_size == 0) {
cache->buff_size = 256;
@@ -243,8 +247,12 @@ lookup_gname_helper(struct name_cache *cache, id_t id)
if (cache->buff == NULL)
return (NULL);
for (;;) {
+#if defined(__sun)
+ result = getgrgid_r((gid_t)id, &grent, cache->buff, cache->buff_size);
+#else
r = getgrgid_r((gid_t)id, &grent,
cache->buff, cache->buff_size, &result);
+#endif
if (r == 0)
break;
if (r != ERANGE)
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk_set_standard_lookup.c b/Utilities/cmlibarchive/libarchive/archive_write_disk_set_standard_lookup.c
index 61124e8..f77e3e3 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_disk_set_standard_lookup.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_disk_set_standard_lookup.c
@@ -122,10 +122,14 @@ lookup_gid(void *private_data, const char *gname, gid_t gid)
size_t bufsize = 128;
char *buffer = _buffer;
struct group grent, *result;
- int r;
+ int r = 0;
for (;;) {
+#if defined(__sun)
+ result = getgrnam_r(gname, &grent, buffer, bufsize);
+#else
r = getgrnam_r(gname, &grent, buffer, bufsize, &result);
+#endif
if (r == 0)
break;
if (r != ERANGE)
@@ -181,10 +185,14 @@ lookup_uid(void *private_data, const char *uname, uid_t uid)
size_t bufsize = 128;
char *buffer = _buffer;
struct passwd pwent, *result;
- int r;
+ int r = 0;
for (;;) {
+#if defined(__sun)
+ result = getpwnam_r(uname, &pwent, buffer, bufsize);
+#else
r = getpwnam_r(uname, &pwent, buffer, bufsize, &result);
+#endif
if (r == 0)
break;
if (r != ERANGE)