diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-01-30 14:17:12 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-01-30 14:17:12 +0800 |
commit | 4617eab09ea42b678c3d6d18c635a0dda3d6ed5a (patch) | |
tree | 6e8d0207d1cedf8032ccb94159e50695388eabe7 /innbbsd/bbslink.c | |
parent | ea44e808f2c7b77c8c92182aef1bd46e90baac23 (diff) | |
download | pttbbs-4617eab09ea42b678c3d6d18c635a0dda3d6ed5a.tar pttbbs-4617eab09ea42b678c3d6d18c635a0dda3d6ed5a.tar.gz pttbbs-4617eab09ea42b678c3d6d18c635a0dda3d6ed5a.tar.bz2 pttbbs-4617eab09ea42b678c3d6d18c635a0dda3d6ed5a.tar.lz pttbbs-4617eab09ea42b678c3d6d18c635a0dda3d6ed5a.tar.xz pttbbs-4617eab09ea42b678c3d6d18c635a0dda3d6ed5a.tar.zst pttbbs-4617eab09ea42b678c3d6d18c635a0dda3d6ed5a.zip |
Use functions from common library.
Reorder extern.h
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4431 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'innbbsd/bbslink.c')
-rw-r--r-- | innbbsd/bbslink.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/innbbsd/bbslink.c b/innbbsd/bbslink.c index b81469d9..a8bd3aea 100644 --- a/innbbsd/bbslink.c +++ b/innbbsd/bbslink.c @@ -1,13 +1,7 @@ -#include "antisplam.h" -#if defined( LINUX ) -#include "innbbsconf.h" -#include "bbslib.h" -#include <stdarg.h> -#else +#include "antisplam.h" #include <stdarg.h> #include "innbbsconf.h" #include "bbslib.h" -#endif #include <sys/mman.h> @@ -187,7 +181,7 @@ bbslink_un_lock(file) { char *lockfile = fileglue("%s.LOCK", file); - if (isfile(lockfile)) + if (dashf(lockfile)) unlink(lockfile); } @@ -459,7 +453,7 @@ process_article(board, filename, userid, nickname, subject) subject = "µLĂD"; } filepath = fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename); - if (isfile(filepath)) { + if (dashf(filepath)) { linkoverview_t lover; if (read_article(&lover, filepath, userid)) { @@ -620,7 +614,7 @@ read_outgoing(sover) fprintf(stderr, "can't open %s/boards/%c/%s/%s\n", BBSHOME, board[0], board, filename); return -1; } - FD_SIZE = filesize(fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename)); + FD_SIZE = dashs(fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename)); if (FD_BUF == NULL) { FD_BUF = (char *)mymalloc(FD_SIZE + 1 + strlen(COMMENT)); } else { @@ -1176,7 +1170,7 @@ cancel_outgoing(board, filename, from, subject) if (strncmp(result, "post to ", 8) == 0) { /* try to remove it */ strncpy(filepath, fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename), sizeof filepath); - if (isfile(filepath)) { + if (dashf(filepath)) { Rename(filepath, fileglue("%s.cancel", filepath)); } FN = fopen(filepath, "w"); @@ -1438,17 +1432,17 @@ send_article() sprintf(sendfile, "%s.sending", site); sprintf(feedfile, "%s.feed", site); sprintf(feedingfile, "%s.feeding", site); - if (isfile(sendfile) && !iszerofile(sendfile)) { + if (dashf(sendfile) && dashs(sendfile) == 0) { if (bbslink_get_lock(sendfile)) { send_nntplink(node, site, nntphost, protocol, port, sendfile, nlcount); bbslink_un_lock(sendfile); } } - if (isfile(linkfile) && !iszerofile(linkfile)) { + if (dashf(linkfile) && dashs(linkfile) == 0) { if (!NoAction) { if (bbslink_get_lock(sendfile) && bbslink_get_lock(linkfile) && bbslink_get_lock(feedingfile)) { - if (isfile(sendfile) && !iszerofile(sendfile)) { + if (dashf(sendfile) && dashs(sendfile) == 0) { save_nntplink(node, sendfile); } if (node->feedfp) { @@ -1465,16 +1459,16 @@ send_article() send_nntplink(node, site, nntphost, protocol, port, linkfile, nlcount); } } - if (isfile(feedingfile) && !iszerofile(feedingfile)) { + if (dashf(feedingfile) && dashs(feedingfile) == 0) { if (bbslink_get_lock(feedingfile)) { send_nntplink(node, site, nntphost, protocol, port, feedingfile, nlcount); bbslink_un_lock(feedingfile); } } - if (isfile(feedfile) && !iszerofile(feedfile)) { + if (dashf(feedfile) && dashs(feedfile) == 0) { if (!NoAction) { if (bbslink_get_lock(feedfile) && bbslink_get_lock(feedingfile)) { - if (isfile(feedingfile) && !iszerofile(feedingfile)) { + if (dashf(feedingfile) && dashs(feedingfile) == 0) { save_nntplink(node, feedingfile); if (node->feedfp) { fclose(node->feedfp); @@ -1638,7 +1632,7 @@ bntplink(argc, argv) } /* getlock */ } /* if NoVisit is false */ sprintf(cancelpost, "%s/cancel.bntp", INNDHOME); - if (isfile(cancelpost)) { + if (dashf(cancelpost)) { FILE *CANCELFILE; if (bbslink_get_lock(cancelpost) && bbslink_get_lock(cancelfile)) { |