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>
-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;
{
struct mconsole_reply reply;
+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);
int mconsole_unlink_socket(void)
{
unlink(mconsole_socket_name);
struct mconsole_notify {
u32 magic;
struct mconsole_notify {
u32 magic;
enum { MCONSOLE_SOCKET, MCONSOLE_PANIC, MCONSOLE_HANG,
MCONSOLE_USER_NOTIFY } type;
u32 len;
enum { MCONSOLE_SOCKET, MCONSOLE_PANIC, MCONSOLE_HANG,
MCONSOLE_USER_NOTIFY } type;
u32 len;
extern char mconsole_socket_name[];
extern int mconsole_unlink_socket(void);
extern char mconsole_socket_name[];
extern int mconsole_unlink_socket(void);
-extern int mconsole_reply(struct mc_request *req, char *reply, int err,
+extern int mconsole_reply_len(struct mc_request *req, const char *reply,
+ int len, int err, int more);
+extern int mconsole_reply(struct mc_request *req, const char *str, int err,
int more);
extern void mconsole_version(struct mc_request *req);
int more);
extern void mconsole_version(struct mc_request *req);
extern void mconsole_stack(struct mc_request *req);
extern int mconsole_get_request(int fd, struct mc_request *req);
extern void mconsole_stack(struct mc_request *req);
extern int mconsole_get_request(int fd, struct mc_request *req);
-extern int mconsole_notify(char *sock_name, int type, const void *data,
+extern int mconsole_notify(char *sock_name, int type, const void *data,
int len);
extern char *mconsole_notify_socket(void);
extern void lock_notify(void);
int len);
extern char *mconsole_notify_socket(void);
extern void lock_notify(void);