diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-12 11:19:46 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-12 11:19:46 +0800 |
commit | 7e0a90828b64bd422f54ac2e6eb15eb4f4749e3a (patch) | |
tree | da60d5af4d6a47f10c994f362404b5f45b38b96e /mbbsd/record.c | |
parent | b1608f31a0d106c73f7538c6e4e0c8f9038a0cbf (diff) | |
download | pttbbs-7e0a90828b64bd422f54ac2e6eb15eb4f4749e3a.tar pttbbs-7e0a90828b64bd422f54ac2e6eb15eb4f4749e3a.tar.gz pttbbs-7e0a90828b64bd422f54ac2e6eb15eb4f4749e3a.tar.bz2 pttbbs-7e0a90828b64bd422f54ac2e6eb15eb4f4749e3a.tar.lz pttbbs-7e0a90828b64bd422f54ac2e6eb15eb4f4749e3a.tar.xz pttbbs-7e0a90828b64bd422f54ac2e6eb15eb4f4749e3a.tar.zst pttbbs-7e0a90828b64bd422f54ac2e6eb15eb4f4749e3a.zip |
safe article delete limited to only hot boards (nuser>20)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1741 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/record.c')
-rw-r--r-- | mbbsd/record.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/mbbsd/record.c b/mbbsd/record.c index 21f1b99d..994c8b09 100644 --- a/mbbsd/record.c +++ b/mbbsd/record.c @@ -210,59 +210,6 @@ int delete_record(char fpath[], int size, int id) return delete_records(fpath, size, id, 1); } -#if 0 -int -delete_record(char fpath[], int size, int id) -{ - nol_t my; - char abuf[BUFSIZE]; - int fdr, fdw, fd; - int count; - - nolfilename(&my, fpath); - if ((fd = open(my.lockfn, O_RDWR | O_CREAT | O_APPEND, 0644)) == -1) - return -1; - - flock(fd, LOCK_EX); - - if ((fdr = open(fpath, O_RDONLY, 0)) == -1) { - move(10, 10); - outs("delete_record failed!!! (open)"); - pressanykey(); - flock(fd, LOCK_UN); - close(fd); - return -1; - } - if ( - ((fdw = open(my.newfn, O_WRONLY | O_CREAT | O_EXCL, 0644)) == -1) && - ((fdw = force_open(my.newfn)) == -1)) { - flock(fd, LOCK_UN); - close(fd); - close(fdr); - return -1; - } - count = 1; - while (read(fdr, abuf, size) == size) { - if (id != count++ && (safewrite(fdw, abuf, size) == -1)) { - unlink(my.newfn); - close(fdr); - close(fdw); - flock(fd, LOCK_UN); - close(fd); - return -1; - } - } - close(fdr); - close(fdw); - if (Rename(fpath, my.oldfn) == -1 || Rename(my.newfn, fpath) == -1) { - flock(fd, LOCK_UN); - close(fd); - return -1; - } - flock(fd, LOCK_UN); - close(fd); - return 0; -} static char * title_body(char *title) @@ -449,7 +396,6 @@ safe_article_delete_range(char *direct, int from, int to) return 0; } -#endif #endif /* !defined(_BBS_UTIL_C_) */ |