9
0
Fork 0

fix fprintf prototype and return value

The puts functions now properly return the number of characters
written. With this we can also fix fprintf.
Also, remove never reached return in fputs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2011-11-11 12:25:53 +01:00
parent e57f57a3d0
commit 1533f6b7b3
2 changed files with 3 additions and 4 deletions

View File

@ -318,7 +318,6 @@ int fputs(int fd, const char *s)
return eputs(s);
else
return write(fd, s, strlen(s));
return 0;
}
EXPORT_SYMBOL(fputs);
@ -333,7 +332,7 @@ void console_flush(void)
}
EXPORT_SYMBOL(console_flush);
void fprintf (int file, const char *fmt, ...)
int fprintf(int file, const char *fmt, ...)
{
va_list args;
uint i;
@ -348,7 +347,7 @@ void fprintf (int file, const char *fmt, ...)
va_end (args);
/* Print the string */
fputs (file, printbuffer);
return fputs(file, printbuffer);
}
EXPORT_SYMBOL(fprintf);

View File

@ -54,7 +54,7 @@ int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
#define stderr 2
#define MAX_FILES 128
void fprintf(int file, const char *fmt, ...) __attribute__ ((format(__printf__, 2, 3)));
int fprintf(int file, const char *fmt, ...) __attribute__ ((format(__printf__, 2, 3)));
int fputs(int file, const char *s);
int fputc(int file, const char c);
int ftstc(int file);