[E-devel] [e] e_sys_main.c

2012-10-31 Thread rustyBSD
Hi,
with recent changes fromCedric Bail in e/src/bin/e_sys_main.c,
OpenBSD needs sys/wait.h. Also removed useless code.

thanks
--- e_sys_main.c	Wed Oct 31 16:09:29 2012
+++ e_sys_main.c	Wed Oct 31 16:07:00 2012
@@ -6,6 +6,7 @@
 #include string.h
 #include sys/types.h
 #include sys/stat.h
+#include sys/wait.h
 #include pwd.h
 #include grp.h
 #include fnmatch.h
@@ -50,7 +51,7 @@
const char *act;
 #endif
gid_t gid, gl[65536], egid;
-   int pid;
+   int pid = 0;
 
for (i = 1; i  argc; i++)
  {
@@ -72,20 +73,21 @@
  test = 1;
  action = argv[2];
   }
-	else if ((argc == 4)  (!strcmp(argv[1], gdb)))
-	  {
- char *end = NULL;
+   else if (!strcmp(argv[1], gdb))
+ {
+if (argc != 4) exit(1);
+char *end = NULL;
 
- action = argv[1];
- pid = strtoul(argv[2], end, 10);
- if (end == NULL || *end != '\0')
-   {
-  printf(Invalid pid for '%s'.\n, argv[3]);
-  exit(0);
-   }
+action = argv[1];
+pid = strtoul(argv[2], end, 10);
+if (end == NULL || *end != '\0')
+  {
+ printf(Invalid pid for '%s'.\n, argv[3]);
+ exit(0);
+  }
 
- output = argv[3];
-	  }
+output = argv[3];
+ }
 #ifdef HAVE_EEZE_MOUNT
 else
   {
@@ -109,8 +111,8 @@
  {
 exit(1);
  }
-   fprintf(stderr, action %s %i\n, action, argc);
if (!action) exit(1);
+   fprintf(stderr, action %s %i\n, action, argc);
 
uid = getuid();
gid = getgid();
@@ -152,13 +154,12 @@
 exit(20);
  }
 
-   if (!(strcmp(argv[1], gdb)))
+   if (!strcmp(action, gdb))
  {
 Eina_Prefix *pfx = NULL;
 char buffer[4096];
 char *tmp;
 char *enlightenment_gdb;
-char *batch;
 int fd;
 int r;
 
@@ -171,12 +172,11 @@
 snprintf(buffer, 4096,
  set logging file %s\nset logging on\nbacktrace full\n,
  output);
-batch = strdup(buffer);
 
 tmp = strdup(/tmp/e-gdb-XX);
 fd = mkstemp(tmp);
 if (fd  0) exit(-1);
-write(fd, batch, strlen(batch));
+write(fd, buffer, strlen(buffer));
 close(fd);
 
 snprintf(buffer, 4096,
@@ -192,7 +192,6 @@
 unlink(tmp);
 
 free(enlightenment_gdb);
-free(batch);
 free(tmp);
 
 exit(WEXITSTATUS(r));
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [e] e_sys_main.c

2012-10-31 Thread Michael Blumenkrantz
in. for future diffs please separate out all formatting changes into
separate patches.

On Wed, Oct 31, 2012 at 3:14 PM, rustyBSD rusty...@gmx.fr wrote:

 Hi,
 with recent changes fromCedric Bail in e/src/bin/e_sys_main.c,
 OpenBSD needs sys/wait.h. Also removed useless code.

 thanks

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [e] e_sys_main.c

2012-10-31 Thread rustyBSD
Le 31/10/2012 16:41, Michael Blumenkrantz a écrit :
 in. for future diffs please separate out all formatting changes into
 separate patches.
ok
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel