search for: write_sbuf

Displaying 3 results from an estimated 3 matches for "write_sbuf".

Did you mean: write_buf
2002 Jan 13
0
rsynd-2.5.1 / io.c patches
...16 || x <= 0x7FFFFFFF) { write_int(f, (int)x); @@ -587,13 +602,13 @@ writefd(f,b,8); } -void write_buf(int f,char *buf,int len) +void write_buf(int f,const void *buf,int len) { writefd(f,buf,len); } /* write a string to the connection */ -static void write_sbuf(int f,char *buf) +static void write_sbuf(int f,const char *buf) { write_buf(f, buf, strlen(buf)); } @@ -601,13 +616,15 @@ void write_byte(int f,unsigned char c) { - write_buf(f,(char *)&c,1); + write_buf(f, &c,1); } -int read_line(int f, char *buf, int max...
2009 Apr 22
2
[Code study] lp_motd_file defination? Help
...; if (!am_client) { > motd = lp_motd_file(); > if (motd && *motd) { > FILE *f = fopen(motd,"r"); > while (f && !feof(f)) { > int len = fread(buf, 1, bufsiz - 1, f); > if (len > 0) > write_buf(f_out, buf, len); > } > if (f) > fclose(f); > write_sbuf(f_out, "\n"); > } > } $ grep "lp_motd_file" . -R ./proto.h:char *lp_motd_file(void); ./loadparm.c:FN_GLOBAL_STRING(lp_motd_file, &Globals.motd_file) ./clientserver.c: motd = lp_motd_file(); -- Daniel
2009 Apr 27
1
[Code study]should we remove if (motd && *motd) section?
..._motd_file(); > if (motd && *motd) { > FILE *f = fopen(motd,"r"); > while (f && !feof(f)) { > int len = fread(buf, 1, bufsiz - 1, f); > if (len > 0) > write_buf(f_out, buf, len); > } > if (f) > fclose(f); > write_sbuf(f_out, "\n"); > } > } > static void init_globals(void) > { > memset(&Globals, 0, sizeof Globals); > } > -- Daniel