comparison input/lirc.c @ 4526:c619a7271690

Remove some unuseful stuff and don't try to kill an unexisting child process on uninit
author albeu
date Mon, 04 Feb 2002 15:03:18 +0000
parents 5105f5da01d6
children d25b898c4c44
comparison
equal deleted inserted replaced
4525:46c4e34b4e76 4526:c619a7271690
31 mp_input_lirc_process(int mp_fd); 31 mp_input_lirc_process(int mp_fd);
32 32
33 33
34 int 34 int
35 mp_input_lirc_init(void) { 35 mp_input_lirc_init(void) {
36 int lirc_flags;
37 int lirc_sock; 36 int lirc_sock;
38 int p[2]; 37 int p[2];
39 38
40 mp_msg(MSGT_LIRC,MSGL_INFO,MSGTR_SettingUpLIRC); 39 mp_msg(MSGT_LIRC,MSGL_INFO,MSGTR_SettingUpLIRC);
41 if((lirc_sock=lirc_init("mplayer",1))==-1){ 40 if((lirc_sock=lirc_init("mplayer",1))==-1){
42 mp_msg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCopenfailed MSGTR_LIRCdisabled); 41 mp_msg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCopenfailed MSGTR_LIRCdisabled);
43 return -1; 42 return -1;
44 } 43 }
45
46 #if 0
47 fcntl(lirc_sock,F_SETOWN,getpid());
48 lirc_flags=fcntl(lirc_sock,F_GETFL,0);
49 if(lirc_flags!=-1) {
50 fcntl(lirc_sock,F_SETFL,lirc_flags|O_NONBLOCK);
51 } else {
52 lirc_deinit();
53 mp_msg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCsocketerr MSGTR_LIRCdisabled,strerror(errno));
54 return -1;
55 }
56 #endif
57
58 44
59 if(lirc_readconfig( lirc_configfile,&lirc_config,NULL )!=0 ){ 45 if(lirc_readconfig( lirc_configfile,&lirc_config,NULL )!=0 ){
60 mp_msg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCcfgerr MSGTR_LIRCdisabled, 46 mp_msg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCcfgerr MSGTR_LIRCdisabled,
61 lirc_configfile == NULL ? "~/.lircrc" : lirc_configfile); 47 lirc_configfile == NULL ? "~/.lircrc" : lirc_configfile);
62 lirc_deinit(); 48 lirc_deinit();
135 mp_input_lirc_process_quit(-1); 121 mp_input_lirc_process_quit(-1);
136 } 122 }
137 123
138 void 124 void
139 mp_input_lirc_uninit(void) { 125 mp_input_lirc_uninit(void) {
126 if(child_pid <= 0)
127 return;
140 if( kill(child_pid,SIGQUIT) != 0) { 128 if( kill(child_pid,SIGQUIT) != 0) {
141 mp_msg(MSGT_LIRC,MSGL_V,"LIRC can't kill subprocess %d : %s\n", 129 mp_msg(MSGT_LIRC,MSGL_V,"LIRC can't kill subprocess %d : %s\n",
142 child_pid,strerror(errno)); 130 child_pid,strerror(errno));
143 return; 131 return;
144 } 132 }