Skip to content

Commit

Permalink
[Server] replace memalign with posix_memalign
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed May 25, 2016
1 parent 296a160 commit 2803921
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/XrdSys/XrdSysLogging.cc
Expand Up @@ -28,7 +28,6 @@
/******************************************************************************/

#include <errno.h>
#include <malloc.h>
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
Expand Down Expand Up @@ -108,8 +107,8 @@ bool XrdSysLogging::Configure(XrdSysLogger &logr, Parms &parms)
// Allocate a log buffer
//
int bsz = (parms.bufsz < 0 ? 65536 : parms.bufsz);
buffOrg = static_cast<char *>(memalign(getpagesize(), bsz));
if (!buffOrg) return EMsg(logr, "Unable to allocate log buffer!\n");
rc = posix_memalign(reinterpret_cast<void**>(&buffOrg), getpagesize(), bsz);
if (rc != 0 || !buffOrg) return EMsg(logr, "Unable to allocate log buffer!\n");

buffBeg = buffOrg + buffOvhd;
buffEnd = buffOrg + bsz;
Expand Down

0 comments on commit 2803921

Please sign in to comment.