[Code study] lp_motd_file defination? Help

Daniel.Li daniel_li at usish.com
Wed Apr 22 07:54:48 GMT 2009


Dear List,

Currently, I read this in clientserver.c, line 148.

motd = lp_motd_file();

I have googled, but didn't the definition of char *lp_motd_file(void).
Can anyone help to explain the following code segment. Many thanks.

#line 147 ~ 160, in clientserver.c, version 3.0.5

> 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



More information about the rsync mailing list