diff options
author | reynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-30 06:40:58 +0000 |
---|---|---|
committer | reynaldo <reynaldo@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-30 06:40:58 +0000 |
commit | bf25812a43c2e3ca244cc1698a7e006391ce34b8 (patch) | |
tree | 5d5f792df73067fc4e2d5ff9295fea966c3baf80 /libmenu/menu_console.c | |
parent | 9c301c3e16546f00e9230abfbe36a45793bd9389 (diff) | |
download | mpv-bf25812a43c2e3ca244cc1698a7e006391ce34b8.tar.bz2 mpv-bf25812a43c2e3ca244cc1698a7e006391ce34b8.tar.xz |
Part1 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17995 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmenu/menu_console.c')
-rw-r--r-- | libmenu/menu_console.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libmenu/menu_console.c b/libmenu/menu_console.c index 5f70b871bd..1005ee2125 100644 --- a/libmenu/menu_console.c +++ b/libmenu/menu_console.c @@ -1,5 +1,7 @@ #include "config.h" +#include "mp_msg.h" +#include "help_mp.h" #include <stdlib.h> #include <stdio.h> @@ -260,10 +262,10 @@ static void check_child(menu_t* menu) { mpriv->prompt = mpriv->mp_prompt; //add_line(mpriv,"Child process exited"); } - else printf("waitpid error: %s\n",strerror(errno)); + else mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_WaitPidError,strerror(errno)); } } else if(r < 0) { - printf("select error\n"); + mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_SelectError); return; } @@ -273,7 +275,7 @@ static void check_child(menu_t* menu) { if(w) mpriv->add_line = 1; r = read(mpriv->child_fd[i],buffer,255); if(r < 0) - printf("Read error on child's %s \n", i == 1 ? "stdout":"stderr"); + mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReadErrorOnChilds, i == 1 ? "stdout":"stderr"); else if(r>0) { buffer[r] = '\0'; add_string(mpriv,buffer); @@ -291,9 +293,9 @@ static int run_shell_cmd(menu_t* menu, char* cmd) { #ifndef __MINGW32__ int in[2],out[2],err[2]; - printf("Console run %s ...\n",cmd); + mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_LIBMENU_ConsoleRun,cmd); if(mpriv->child) { - printf("A child is alredy running\n"); + mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_AChildIsAlreadyRunning); return 0; } @@ -303,7 +305,7 @@ static int run_shell_cmd(menu_t* menu, char* cmd) { mpriv->child = fork(); if(mpriv->child < 0) { - printf("Fork failed !!!\n"); + mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ForkFailed); close_pipe(in); close_pipe(out); close_pipe(err); @@ -377,14 +379,14 @@ static void read_key(menu_t* menu,int c) { while(l > 0) { int w = write(mpriv->child_fd[0],str,l); if(w < 0) { - printf("Write error\n"); + mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_WriteError); break; } l -= w; str += w; } if(write(mpriv->child_fd[0],"\n",1) < 0) - printf("Write error\n"); + mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_WriteError); enter_cmd(menu); return; } |