From e041c43c8961880cebbc18c1be59bde99582ea2a Mon Sep 17 00:00:00 2001 From: wens Date: Mon, 8 Aug 2005 14:23:24 +0000 Subject: =?UTF-8?q?add=20super=20sys=20support=20op=20(=E7=BE=A4=E7=B5=84?= =?UTF-8?q?=E9=95=B7)=20HUGETLB=20doesn't=20need=20root?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3010 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/uhash_loader.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'util') diff --git a/util/uhash_loader.c b/util/uhash_loader.c index 0654d60c..3400e153 100644 --- a/util/uhash_loader.c +++ b/util/uhash_loader.c @@ -12,10 +12,8 @@ SHM_t *SHM; int main() { -#ifndef USE_HUGETLB setgid(BBSGID); setuid(BBSUID); -#endif chdir(BBSHOME); load_uhash(); return 0; @@ -25,20 +23,16 @@ void load_uhash(void) { int shmid, err; shmid = shmget(SHM_KEY, SHMSIZE, #ifdef USE_HUGETLB - SHM_HUGETLB | 0666 | -#else - 0600 | + SHM_HUGETLB | #endif - IPC_CREAT | IPC_EXCL); + 0600 | IPC_CREAT | IPC_EXCL); err = errno; if( err == EEXIST ) shmid = shmget(SHM_KEY, SHMSIZE, #ifdef USE_HUGETLB - SHM_HUGETLB | 0666 | -#else - 0600 | + SHM_HUGETLB | #endif - IPC_CREAT); + 0600 | IPC_CREAT); if( shmid < 0 ){ perror("shmget"); -- cgit v1.2.3