From: Benjamin Kaduk Date: Fri, 10 Jan 2014 04:34:30 +0000 (-0500) Subject: Disable some explicit sbrk() usage X-Git-Tag: upstream/1.6.8^2~63 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=23709f03a38eca661529b745b185393a0a239835;p=packages%2Fo%2Fopenafs.git Disable some explicit sbrk() usage Mac OS X 10.9 now considers this function deprecated and warns on its use, causing the buildslave configuration to error out. On master, we added a library routine to get a process's size to opr; opr is not present on the 1.6 branch so another route is needed here. Since use of the OS X malloc implementation appears to have no effect on the result of sbrk(0), there is no loss of functionality by replacing the function call with a (different) constant value. There may still be some value in sbrk(0) on other systems, so only disable sbrk() for OS X, on the stable branch. This change is specific to the 1.6 branch. Change-Id: Ie5f96e923b78be22a9ce83d0a35a7675d517b073 Reviewed-on: http://gerrit.openafs.org/10746 Tested-by: BuildBot Reviewed-by: D Brashear Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand --- diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 2d86ea9f6..d831bd79d 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -5765,7 +5765,7 @@ SetAFSStats(struct AFSStatistics *stats) if (seconds <= 0) seconds = 1; stats->StoreDataRate = AFSCallStats.TotalStoredBytes / seconds; -#ifdef AFS_NT40_ENV +#if defined(AFS_NT40_ENV) || defined(AFS_DARWIN_ENV) stats->ProcessSize = -1; /* TODO: */ #else stats->ProcessSize = (afs_int32) ((long)sbrk(0) >> 10); @@ -5927,7 +5927,7 @@ SRXAFS_GetStatistics64(struct rx_call *acall, afs_int32 statsVersion, ViceStatis seconds = 1; Statistics->ViceStatistics64_val[STATS64_STOREDATARATE] = AFSCallStats.TotalStoredBytes / seconds; -#ifdef AFS_NT40_ENV +#if defined(AFS_NT40_ENV) || defined(AFS_DARWIN_ENV) Statistics->ViceStatistics64_val[STATS64_PROCESSSIZE] = -1; #else Statistics->ViceStatistics64_val[STATS64_PROCESSSIZE] = diff --git a/src/viced/viced.c b/src/viced/viced.c index 24ecfa201..6878e31da 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -735,7 +735,7 @@ PrintCounters(void) audit_PrintStats(stderr); h_PrintStats(); PrintCallBackStats(); -#ifdef AFS_NT40_ENV +#if defined(AFS_NT40_ENV) || defined(AFS_DARWIN_ENV) processSize = -1; /* TODO: */ #else processSize = (int)((long)sbrk(0) >> 10);