summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-08 22:23:24 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-08 22:23:24 +0800
commite041c43c8961880cebbc18c1be59bde99582ea2a (patch)
treee9ae727e9d3e52ffbb524714644d635bcbc44b47 /util
parent72fa46586658fa5a7e797e66167583b17cb5a858 (diff)
downloadpttbbs-e041c43c8961880cebbc18c1be59bde99582ea2a.tar
pttbbs-e041c43c8961880cebbc18c1be59bde99582ea2a.tar.gz
pttbbs-e041c43c8961880cebbc18c1be59bde99582ea2a.tar.bz2
pttbbs-e041c43c8961880cebbc18c1be59bde99582ea2a.tar.lz
pttbbs-e041c43c8961880cebbc18c1be59bde99582ea2a.tar.xz
pttbbs-e041c43c8961880cebbc18c1be59bde99582ea2a.tar.zst
pttbbs-e041c43c8961880cebbc18c1be59bde99582ea2a.zip
add super sys support op (群組長)
HUGETLB doesn't need root git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3010 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/uhash_loader.c14
1 files changed, 4 insertions, 10 deletions
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");