lib: smbreadline xfile->stdio
authorVolker Lendecke <vl@samba.org>
Wed, 23 Nov 2016 09:07:48 +0000 (10:07 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 11 Dec 2016 10:17:24 +0000 (11:17 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smbreadline/smbreadline.c

index 8be6e4855f7b3b6136210258cc8186733fa893b0..1a0f61c2cfed5d58354be3045bdaa19cc212f459 100644 (file)
@@ -24,7 +24,6 @@
 #include "system/select.h"
 #include "system/readline.h"
 #include "libcli/smbreadline/smbreadline.h"
-#include "lib/util/xfile.h"
 
 #undef malloc
 
@@ -72,13 +71,13 @@ static char *smb_readline_replacement(const char *prompt, void (*callback)(void)
                                char **(completion_fn)(const char *text, int start, int end))
 {
        char *line = NULL;
-       int fd = x_fileno(x_stdin);
+       int fd = fileno(stdin);
        char *ret;
 
        /* Prompt might be NULL in non-interactive mode. */
        if (prompt) {
-               x_fprintf(x_stdout, "%s", prompt);
-               x_fflush(x_stdout);
+               printf("%s", prompt);
+               fflush(stdout);
        }
 
        line = (char *)malloc(BUFSIZ);
@@ -94,7 +93,7 @@ static char *smb_readline_replacement(const char *prompt, void (*callback)(void)
                pfd.events = POLLIN|POLLHUP;
 
                if (sys_poll_intr(&pfd, 1, 5000) == 1) {
-                       ret = x_fgets(line, BUFSIZ, x_stdin);
+                       ret = fgets(line, BUFSIZ, stdin);
                        if (ret == 0) {
                                SAFE_FREE(line);
                        }
@@ -118,7 +117,7 @@ char *smb_readline(const char *prompt, void (*callback)(void),
        char *ret;
        bool interactive;
 
-       interactive = isatty(x_fileno(x_stdin)) || getenv("CLI_FORCE_INTERACTIVE");
+       interactive = isatty(fileno(stdin)) || getenv("CLI_FORCE_INTERACTIVE");
        if (!interactive) {
                return smb_readline_replacement(NULL, callback, completion_fn);
        }