summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-09-22 01:25:27 -0500
committerEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-09-22 01:25:27 -0500
commitd12cc17afd5ee2c9b589cf5ceb632a98e6f31ecf (patch)
tree1f12bb0b79bd206fbba0dc9eac23f779e67d452b
parentf4c980e4b38165322ad005e032cfbda40471b9ed (diff)
downloadsegfault-d12cc17afd5ee2c9b589cf5ceb632a98e6f31ecf.tar.gz
segfault-d12cc17afd5ee2c9b589cf5ceb632a98e6f31ecf.zip
made changetail also go by inode when matching for tails to change.
-rw-r--r--segfault.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/segfault.c b/segfault.c
index ed9818e..926c93d 100644
--- a/segfault.c
+++ b/segfault.c
@@ -385,8 +385,10 @@ void c_leettail(int fd,char *from,char *file,struct user *user,...) {
}
void c_changetail(int fd,char *from,char *line,struct user *user,...) {
+ struct stat st;
char *merp=0;
int i;
+ int fdd;
char *mode=0;
//if(line == 0) return mywrite(fd,"QUIT :line == 0 in changetail\r\n");
//if(from == 0) return mywrite(fd,"QUIT :from == 0 in changetail\r\n");
@@ -398,10 +400,12 @@ void c_changetail(int fd,char *from,char *line,struct user *user,...) {
mode++;
}
}
+ fdd=open(line,O_RDONLY|O_NONBLOCK,0);//HAVE to open named pipes as nonblocking.
+ fstat(fdd,&st);
for(i=0;i<MAXTAILS;i++) {
//if(tailf[i].file == 0) return mywrite(fd,"QUIT :tailf[i].file == 0 in changetail\r\n");
if(tailf[i].file) {
- if(!strcmp(tailf[i].file,line)) {
+ if(!strcmp(tailf[i].file,line) || tailf[i].inode == st.st_ino) {
free(tailf[i].to);
tailf[i].to=strdup(merp);
if(mode) {