1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-06 16:23:49 +03:00

r18343: fixed setlinebuf() prototype, added test for it, and use it in two

places to avoid a #ifdef
This commit is contained in:
Andrew Tridgell
2006-09-10 14:19:38 +00:00
committed by Gerald (Jerry) Carter
parent e191f84f24
commit 095b805774
5 changed files with 7 additions and 10 deletions

View File

@@ -338,9 +338,9 @@ char *rep_inet_ntoa(struct in_addr ip)
#endif #endif
#ifndef HAVE_SETLINEBUF #ifndef HAVE_SETLINEBUF
int rep_setlinebuf(FILE *stream) void rep_setlinebuf(FILE *stream)
{ {
return setvbuf(stream, (char *)NULL, _IOLBF, 0); setvbuf(stream, (char *)NULL, _IOLBF, 0);
} }
#endif /* HAVE_SETLINEBUF */ #endif /* HAVE_SETLINEBUF */

View File

@@ -140,7 +140,7 @@ int rep_setegid(gid_t);
#ifndef HAVE_SETLINEBUF #ifndef HAVE_SETLINEBUF
#define setlinebuf rep_setlinebuf #define setlinebuf rep_setlinebuf
int rep_setlinebuf(FILE *); void rep_setlinebuf(FILE *);
#endif #endif
#ifndef HAVE_STRCASESTR #ifndef HAVE_STRCASESTR

View File

@@ -146,7 +146,8 @@ static int test_strdup(void)
static int test_setlinebuf(void) static int test_setlinebuf(void)
{ {
/* FIXME */ printf("testing setlinebuf\n");
setlinebuf(stdout);
return true; return true;
} }

View File

@@ -413,9 +413,7 @@ const static struct torture_ui_ops quiet_ui_ops = {
{ NULL } { NULL }
}; };
#ifdef HAVE_SETBUFFER setlinebuf(stdout);
setbuffer(stdout, NULL, 0);
#endif
/* we are never interested in SIGPIPE */ /* we are never interested in SIGPIPE */
BlockSignals(True,SIGPIPE); BlockSignals(True,SIGPIPE);

View File

@@ -151,9 +151,7 @@ static int binary_net(int argc, const char **argv)
{ NULL } { NULL }
}; };
#ifdef HAVE_SETBUFFER setlinebuf(stdout);
setbuffer(stdout, NULL, 0);
#endif
pc = poptGetContext("net", argc, (const char **) argv, long_options, pc = poptGetContext("net", argc, (const char **) argv, long_options,
POPT_CONTEXT_KEEP_FIRST); POPT_CONTEXT_KEEP_FIRST);