# HG changeset patch # User mmj # Date 1082819876 -36000 # Node ID d318f80489254ff6951fa59cec30c2c53cfc693e # Parent 57cc975a4721b4c492ec9f94097d77ec6defae1d Let find_subscriber return the offset of the subscriber in the subscriber file. diff -r 57cc975a4721 -r d318f8048925 src/subscriberfuncs.c --- a/src/subscriberfuncs.c Sat Apr 24 20:27:16 2004 +1000 +++ b/src/subscriberfuncs.c Sun Apr 25 01:17:56 2004 +1000 @@ -19,8 +19,9 @@ #include "subscriberfuncs.h" #include "mygetline.h" #include "log_error.h" +#include "wrappers.h" -int find_subscriber(int fd, const char *address) +off_t find_subscriber(int fd, const char *address) { char *start, *cur, *next; struct stat st; @@ -43,7 +44,7 @@ if((strlen(address) == len) && (strncasecmp(address, cur, len) == 0)) { munmap(start, st.st_size); - return 0; + return (off_t)(cur - start); } cur = next + 1; } @@ -54,10 +55,10 @@ if((strlen(address) == len) && (strncasecmp(address, cur, len) == 0)) { munmap(start, st.st_size); - return 0; + return (off_t)(cur - start); } } munmap(start, st.st_size); - return 1; + return (off_t)-1; }