diff options
author | Jeff Dike <jdike@addtoit.com> | 2006-01-06 11:19:03 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 19:33:47 +0300 |
commit | 7b033e1fdeef3d8bacac3cd5cfa53c9d670d1f3d (patch) | |
tree | 632948968ea0d61bc323f419866d3d037a99f0a5 /arch/um/drivers/mconsole_user.c | |
parent | 44700a4469b6bb89e6f1edd32b8a4a915dd967c6 (diff) | |
download | linux-7b033e1fdeef3d8bacac3cd5cfa53c9d670d1f3d.tar.xz |
[PATCH] uml: add mconsole_reply variant with length param
This is needed for the console output patch, since we have a possibly
non-NULL-terminated string there. So, the new interface takes a string and a
length, and the old interface calls strlen on its string and calls the new
interface with the length.
There's also a bit of whitespace cleanup.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/drivers/mconsole_user.c')
-rw-r--r-- | arch/um/drivers/mconsole_user.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/um/drivers/mconsole_user.c b/arch/um/drivers/mconsole_user.c index 310c1f823f26..4b109fe7fff8 100644 --- a/arch/um/drivers/mconsole_user.c +++ b/arch/um/drivers/mconsole_user.c @@ -122,12 +122,12 @@ int mconsole_get_request(int fd, struct mc_request *req) return(1); } -int mconsole_reply(struct mc_request *req, char *str, int err, int more) +int mconsole_reply_len(struct mc_request *req, const char *str, int total, + int err, int more) { struct mconsole_reply reply; - int total, len, n; + int len, n; - total = strlen(str); do { reply.err = err; @@ -155,6 +155,12 @@ int mconsole_reply(struct mc_request *req, char *str, int err, int more) return(0); } +int mconsole_reply(struct mc_request *req, const char *str, int err, int more) +{ + return mconsole_reply_len(req, str, strlen(str), err, more); +} + + int mconsole_unlink_socket(void) { unlink(mconsole_socket_name); |