[uim-commit] r2532 - in trunk: fep helper uim

kzk at freedesktop.org kzk at freedesktop.org
Sun Dec 11 17:09:05 PST 2005


Author: kzk
Date: 2005-12-11 17:09:01 -0800 (Sun, 11 Dec 2005)
New Revision: 2532

Modified:
   trunk/fep/str.c
   trunk/fep/udsock.c
   trunk/fep/uim-fep.c
   trunk/helper/dict-main-gtk.c
   trunk/helper/dict-word-list-win-gtk.c
   trunk/helper/helper-candwin-gtk.c
   trunk/helper/im-switcher-gtk.c
   trunk/uim/agent.c
   trunk/uim/slib.c
   trunk/uim/uim-module-manager.c
Log:
* uim/uim-module-manager.c
  - (main): use EXIT_FAILURE as an argument of exit(3) and print error
  message when requiring "uim-module-manage.scm" fails.

* fep/uim-fep.c
  - (init_uim): use EXIT_FAILURE as an argument of exit(3)
* fep/str.c
  - (init_str): Ditto
* fep/udsock.c
  - (init_recvsocket): Ditto
* helper/dict-word-list-win-gtk.c
  - (word_list_window_init): Ditto
* helper/im-switcher-gtk.c
  - (main): Ditto
* helper/helper-candwin-gtk.c
  - (read_cb): Ditto
* helper/dict-main-gtk.c
  - (main): Ditto
* uim/agent.c
  - (init_agent): Ditto. exit(0) is invalid for this situation.
* uim/slib.c
  - (my_err): Ditto



Modified: trunk/fep/str.c
===================================================================
--- trunk/fep/str.c	2005-12-12 00:43:49 UTC (rev 2531)
+++ trunk/fep/str.c	2005-12-12 01:09:01 UTC (rev 2532)
@@ -73,7 +73,7 @@
 {
   if (setlocale(LC_CTYPE, "") == NULL) {
     printf("locale not supported\n");
-    exit(1);
+    exit(EXIT_FAILURE);
   }
   s_utf8 = (strcasecmp(get_enc(), "UTF-8") == 0 || strcasecmp(get_enc(), "UTF8") == 0);
 }

Modified: trunk/fep/udsock.c
===================================================================
--- trunk/fep/udsock.c	2005-12-12 00:43:49 UTC (rev 2531)
+++ trunk/fep/udsock.c	2005-12-12 01:09:01 UTC (rev 2532)
@@ -118,7 +118,7 @@
   strncpy(s_servaddr.sun_path, sock_path, UNIX_PATH_MAX - 1);
   if (bind(s_recv_sockfd, (struct sockaddr *)&s_servaddr, sizeof(s_servaddr)) < 0) {
     perror(sock_path);
-    exit(1);
+    exit(EXIT_FAILURE);
   }
   chmod(sock_path, S_IRUSR|S_IWUSR);
 }

Modified: trunk/fep/uim-fep.c
===================================================================
--- trunk/fep/uim-fep.c	2005-12-12 00:43:49 UTC (rev 2531)
+++ trunk/fep/uim-fep.c	2005-12-12 01:09:01 UTC (rev 2532)
@@ -203,7 +203,7 @@
   if (i == nr) {
     printf("%s is not a input method\n\n", engine);
     usage();
-    exit(1);
+    exit(EXIT_FAILURE);
   }
 }
 

Modified: trunk/helper/dict-main-gtk.c
===================================================================
--- trunk/helper/dict-main-gtk.c	2005-12-12 00:43:49 UTC (rev 2531)
+++ trunk/helper/dict-main-gtk.c	2005-12-12 01:09:01 UTC (rev 2532)
@@ -224,7 +224,7 @@
 
   if (result == -1) {
     g_printerr(_("Error:%s\n"), get_error_msg());
-    exit(-1);
+    exit(EXIT_FAILURE);
   }
 
   /* connect to uim helper message bus */

Modified: trunk/helper/dict-word-list-win-gtk.c
===================================================================
--- trunk/helper/dict-word-list-win-gtk.c	2005-12-12 00:43:49 UTC (rev 2531)
+++ trunk/helper/dict-word-list-win-gtk.c	2005-12-12 01:09:01 UTC (rev 2532)
@@ -272,7 +272,7 @@
   dict = uim_dict_open(N_("Anthy private dictionary"));
   if (!dict) {
     warn_dict_open();
-    exit(1);
+    exit(EXIT_FAILURE);
   }
 #endif
   word_list_view_set_dict(WORD_LIST_VIEW(word_list), dict);

Modified: trunk/helper/helper-candwin-gtk.c
===================================================================
--- trunk/helper/helper-candwin-gtk.c	2005-12-12 00:43:49 UTC (rev 2531)
+++ trunk/helper/helper-candwin-gtk.c	2005-12-12 01:09:01 UTC (rev 2532)
@@ -586,7 +586,7 @@
     n = read(fd, buf, CANDIDATE_BUFFER_SIZE - 1);
     if (n == 0) {
       close(fd);
-      exit(-1);
+      exit(EXIT_FAILURE);
     }
     if (n == -1)
       return TRUE;

Modified: trunk/helper/im-switcher-gtk.c
===================================================================
--- trunk/helper/im-switcher-gtk.c	2005-12-12 00:43:49 UTC (rev 2531)
+++ trunk/helper/im-switcher-gtk.c	2005-12-12 01:09:01 UTC (rev 2532)
@@ -536,7 +536,7 @@
 
   if (result == -1) {
     fprintf(stderr, "Error:%s\n", get_error_msg());
-    exit(-1);
+    exit(EXIT_FAILURE);
   }
 
   /* connect to uim helper message bus */

Modified: trunk/uim/agent.c
===================================================================
--- trunk/uim/agent.c	2005-12-12 00:43:49 UTC (rev 2531)
+++ trunk/uim/agent.c	2005-12-12 01:09:01 UTC (rev 2532)
@@ -72,7 +72,7 @@
   int i, nr;
   if (uim_init() == -1) {
     printf("failed to init\n");
-    exit(0);
+    exit(EXIT_FAILURE);
   }
   /**/
   uc =uim_create_context(&default_context,

Modified: trunk/uim/slib.c
===================================================================
--- trunk/uim/slib.c	2005-12-12 00:43:49 UTC (rev 2531)
+++ trunk/uim/slib.c	2005-12-12 01:09:01 UTC (rev 2532)
@@ -511,7 +511,7 @@
   if (fatal_exit_hook)
     (*fatal_exit_hook) ();
   else
-    exit (1);
+    exit (EXIT_FAILURE);
   return (NIL);
 }
 

Modified: trunk/uim/uim-module-manager.c
===================================================================
--- trunk/uim/uim-module-manager.c	2005-12-12 00:43:49 UTC (rev 2531)
+++ trunk/uim/uim-module-manager.c	2005-12-12 01:09:01 UTC (rev 2532)
@@ -225,8 +225,10 @@
   uim_scm_init_subr_1("write-loader.scm", write_loader_scm);
   uim_scm_init_subr_1("write-installed-modules.scm", write_installed_modules_scm);
 
-  if (!uim_scm_require_file("uim-module-manager.scm"))
-    exit(1);
+  if (!uim_scm_require_file("uim-module-manager.scm")) {
+    perror("failed to require uim-module-manager.scm");
+    exit(EXIT_FAILURE);
+  }
 
   if (path) {
     char *extra_file = concat(path, "/installed-modules.scm");



More information about the uim-commit mailing list