Enlightenment CVS committal
Author : codewarrior
Project : e17
Module : proto
Dir : e17/proto/enterminus/src/bin
Modified Files:
enterm.c pty.c term.h
Added Files:
enterm.h
Log Message:
1) added enterm.h
2) removed pid (global var) into term->pid
3) trying to get signal() implemented via ecore events, no dice yet, so when
you type exit, the window wont close
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/enterm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- enterm.c 18 Feb 2005 23:19:06 -0000 1.2
+++ enterm.c 19 Feb 2005 10:15:37 -0000 1.3
@@ -26,7 +26,7 @@
}
-void enterm_cb_title_change(void *data, int type, void *ev) {
+int enterm_cb_title_change(void *data, int type, void *ev) {
Term_Event_Title_Change *e;
Ecore_Evas *ee;
@@ -34,4 +34,5 @@
ee = data;
ecore_x_window_prop_title_set(ecore_evas_software_x11_window_get(ee),
e->title);
+ return 1;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/pty.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- pty.c 11 Feb 2005 13:07:56 -0000 1.4
+++ pty.c 19 Feb 2005 10:15:37 -0000 1.5
@@ -14,7 +14,8 @@
/* do we need this here? */
/* extern char *ptsname(); */
int fd;
-
+ char *ptydev;
+
if((fd = getpt()) >= 0)
{
if(grantpt(fd) == 0 && unlockpt(fd) == 0)
@@ -59,11 +60,15 @@
return 0;
}
-void sigchld_handler(int a) {
+void sigchld_handler(void *data, int type, void *ev){//int a) {
int status = 0;
+ Term *term;
+ term = data;
- if(waitpid(pid, &status, 0) < 0) {
- fprintf(stderr, "Waiting for pid %hd failed: %m\n", pid);
+ printf("Exec singchld_handler %d\n",term->pid);
+
+ if(waitpid(term->pid, &status, 0) < 0) {
+ fprintf(stderr, "Waiting for pid %hd failed: %m\n", term->pid);
exit(1);
}
@@ -77,6 +82,7 @@
exit(1);
else /* Something strange happened */
exit(1);
+
exit(0);
}
@@ -108,11 +114,11 @@
if((term->cmd_fd.sys = get_pty(term)) < 0)
return -1;
- if((pid = fork()) < 0) {
+ if((term->pid = fork()) < 0) {
fprintf(stderr, "Couldn't fork: %m\n");
return -1;
}
- if(!pid) {
+ if(!term->pid) {
/* child */
get_tty(term);
@@ -134,7 +140,10 @@
/* parent */
close(term->slave.sys);
- signal(SIGCHLD, sigchld_handler);
+ //signal(SIGCHLD, sigchld_handler);
+ ecore_event_handler_add(SIGCHLD, sigchld_handler, term);
+
return 0;
}
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/enterminus/src/bin/term.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- term.h 18 Feb 2005 23:19:06 -0000 1.6
+++ term.h 19 Feb 2005 10:15:37 -0000 1.7
@@ -47,8 +47,8 @@
typedef struct _Term_Event_Title_Change Term_Event_Title_Change;
/* are those still global vars? if so, remove them */
-char *ptydev, *ttydev;
-pid_t pid;
+//char *ptydev, *ttydev;
+//pid_t pid;
struct _Term_Fd {
int sys;
@@ -106,6 +106,7 @@
struct _Term {
int term_id;
+ pid_t pid;
Ecore_Evas *ee;
Term_TCanvas *tcanvas;
Term_EGlyph *grid;
@@ -147,7 +148,8 @@
struct winsize *get_font_dim(Term *term);
int get_pty(Term *term);
int get_tty(Term *term);
-void sigchld_handler(int a);
+//void sigchld_handler(int a);
+void sigchld_handler(void *data, int type, void *ev);
struct passwd *find_user(void);
int execute_command(Term *term);//, int argc, const char **argv);
@@ -187,8 +189,5 @@
void term_smart_clip_unset(Evas_Object *o);
Evas_Smart *term_smart_get();
-void enterm_init(Ecore_Evas *ee, Evas_Object *term);
-void enterm_cb_resize(Ecore_Evas *ee);
-
void term_event_title_change_free(void *data, void *ev);
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs