Browse code

syslogにゴミが出ないように修正

Masanobu Yasui authored on 2012/09/05 02:32:35
Showing 7 changed files
... ...
@@ -38,7 +38,7 @@ subdir = .
38 38
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
39 39
 	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
40 40
 	$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
41
-	depcomp install-sh missing
41
+	compile depcomp install-sh missing
42 42
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
43 43
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
44 44
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
... ...
@@ -639,6 +639,41 @@ AC_MSG_RESULT([$_am_result])
639 639
 rm -f confinc confmf
640 640
 ])
641 641
 
642
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
643
+# Free Software Foundation, Inc.
644
+#
645
+# This file is free software; the Free Software Foundation
646
+# gives unlimited permission to copy and/or distribute it,
647
+# with or without modifications, as long as this notice is preserved.
648
+
649
+# serial 6
650
+
651
+# AM_PROG_CC_C_O
652
+# --------------
653
+# Like AC_PROG_CC_C_O, but changed for automake.
654
+AC_DEFUN([AM_PROG_CC_C_O],
655
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
656
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
657
+AC_REQUIRE_AUX_FILE([compile])dnl
658
+# FIXME: we rely on the cache variable name because
659
+# there is no other way.
660
+set dummy $CC
661
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
662
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
663
+if test "$am_t" != yes; then
664
+   # Losing compiler, so override with the script.
665
+   # FIXME: It is wrong to rewrite CC.
666
+   # But if we don't then we get into trouble of one sort or another.
667
+   # A longer-term fix would be to have automake use am__CC in this case,
668
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
669
+   CC="$am_aux_dir/compile $CC"
670
+fi
671
+dnl Make sure AC_PROG_CC is never called again, or it will override our
672
+dnl setting of CC.
673
+m4_define([AC_PROG_CC],
674
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
675
+])
676
+
642 677
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
643 678
 
644 679
 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
... ...
@@ -131,6 +131,8 @@ int workend(mcomm *c)
131 131
     if(c->logover && strcmp("dsync", c->parse[0][0])){
132 132
       if(cprintf(0, c, "[error] Log lost: %d lines\n", c->logover) == 0){
133 133
         c->logover = 0;
134
+      }else{
135
+        c->logover--;
134 136
       }
135 137
     }
136 138
     if(c->logfail){
... ...
@@ -141,6 +143,8 @@ int workend(mcomm *c)
141 141
   }
142 142
   if(cprintf(0, c, m) == 0){
143 143
     c->working = 0;
144
+  }else{
145
+    c->logover--;
144 146
   }
145 147
   return(0);
146 148
 }
... ...
@@ -236,6 +236,9 @@
236 236
    slash. */
237 237
 #undef LSTAT_FOLLOWS_SLASHED_SYMLINK
238 238
 
239
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
240
+#undef NO_MINUS_C_MINUS_O
241
+
239 242
 /* Name of package */
240 243
 #undef PACKAGE
241 244
 
... ...
@@ -1,6 +1,6 @@
1 1
 #! /bin/sh
2 2
 # Guess values for system-dependent variables and create Makefiles.
3
-# Generated by GNU Autoconf 2.67 for makuosan 1.3.4.
3
+# Generated by GNU Autoconf 2.67 for makuosan 1.3.4.1.
4 4
 #
5 5
 # Report bugs to <info-makuosan@klab.jp>.
6 6
 #
... ...
@@ -552,8 +552,8 @@ MAKEFLAGS=
552 552
 # Identity of this package.
553 553
 PACKAGE_NAME='makuosan'
554 554
 PACKAGE_TARNAME='makuosan'
555
-PACKAGE_VERSION='1.3.4'
556
-PACKAGE_STRING='makuosan 1.3.4'
555
+PACKAGE_VERSION='1.3.4.1'
556
+PACKAGE_STRING='makuosan 1.3.4.1'
557 557
 PACKAGE_BUGREPORT='info-makuosan@klab.jp'
558 558
 PACKAGE_URL=''
559 559
 
... ...
@@ -1236,7 +1236,7 @@ if test "$ac_init_help" = "long"; then
1236 1236
   # Omit some internal or obsolete options to make the list less imposing.
1237 1237
   # This message is too long to be a string in the A/UX 3.1 sh.
1238 1238
   cat <<_ACEOF
1239
-\`configure' configures makuosan 1.3.4 to adapt to many kinds of systems.
1239
+\`configure' configures makuosan 1.3.4.1 to adapt to many kinds of systems.
1240 1240
 
1241 1241
 Usage: $0 [OPTION]... [VAR=VALUE]...
1242 1242
 
... ...
@@ -1302,7 +1302,7 @@ fi
1302 1302
 
1303 1303
 if test -n "$ac_init_help"; then
1304 1304
   case $ac_init_help in
1305
-     short | recursive ) echo "Configuration of makuosan 1.3.4:";;
1305
+     short | recursive ) echo "Configuration of makuosan 1.3.4.1:";;
1306 1306
    esac
1307 1307
   cat <<\_ACEOF
1308 1308
 
... ...
@@ -1389,7 +1389,7 @@ fi
1389 1389
 test -n "$ac_init_help" && exit $ac_status
1390 1390
 if $ac_init_version; then
1391 1391
   cat <<\_ACEOF
1392
-makuosan configure 1.3.4
1392
+makuosan configure 1.3.4.1
1393 1393
 generated by GNU Autoconf 2.67
1394 1394
 
1395 1395
 Copyright (C) 2010 Free Software Foundation, Inc.
... ...
@@ -1968,7 +1968,7 @@ cat >config.log <<_ACEOF
1968 1968
 This file contains any messages produced by compilers while
1969 1969
 running configure, to aid debugging if configure makes a mistake.
1970 1970
 
1971
-It was created by makuosan $as_me 1.3.4, which was
1971
+It was created by makuosan $as_me 1.3.4.1, which was
1972 1972
 generated by GNU Autoconf 2.67.  Invocation command line was
1973 1973
 
1974 1974
   $ $0 $@
... ...
@@ -2784,7 +2784,7 @@ fi
2784 2784
 
2785 2785
 # Define the identity of the package.
2786 2786
  PACKAGE='makuosan'
2787
- VERSION='1.3.4'
2787
+ VERSION='1.3.4.1'
2788 2788
 
2789 2789
 
2790 2790
 cat >>confdefs.h <<_ACEOF
... ...
@@ -3808,6 +3808,132 @@ else
3808 3808
 fi
3809 3809
 
3810 3810
 
3811
+if test "x$CC" != xcc; then
3812
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
3813
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
3814
+else
3815
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
3816
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
3817
+fi
3818
+set dummy $CC; ac_cc=`$as_echo "$2" |
3819
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
3820
+if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then :
3821
+  $as_echo_n "(cached) " >&6
3822
+else
3823
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3824
+/* end confdefs.h.  */
3825
+
3826
+int
3827
+main ()
3828
+{
3829
+
3830
+  ;
3831
+  return 0;
3832
+}
3833
+_ACEOF
3834
+# Make sure it works both with $CC and with simple cc.
3835
+# We do the test twice because some compilers refuse to overwrite an
3836
+# existing .o file with -o, though they will create one.
3837
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
3838
+rm -f conftest2.*
3839
+if { { case "(($ac_try" in
3840
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3841
+  *) ac_try_echo=$ac_try;;
3842
+esac
3843
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3844
+$as_echo "$ac_try_echo"; } >&5
3845
+  (eval "$ac_try") 2>&5
3846
+  ac_status=$?
3847
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3848
+  test $ac_status = 0; } &&
3849
+   test -f conftest2.$ac_objext && { { case "(($ac_try" in
3850
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3851
+  *) ac_try_echo=$ac_try;;
3852
+esac
3853
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3854
+$as_echo "$ac_try_echo"; } >&5
3855
+  (eval "$ac_try") 2>&5
3856
+  ac_status=$?
3857
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3858
+  test $ac_status = 0; };
3859
+then
3860
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
3861
+  if test "x$CC" != xcc; then
3862
+    # Test first that cc exists at all.
3863
+    if { ac_try='cc -c conftest.$ac_ext >&5'
3864
+  { { case "(($ac_try" in
3865
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3866
+  *) ac_try_echo=$ac_try;;
3867
+esac
3868
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3869
+$as_echo "$ac_try_echo"; } >&5
3870
+  (eval "$ac_try") 2>&5
3871
+  ac_status=$?
3872
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3873
+  test $ac_status = 0; }; }; then
3874
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
3875
+      rm -f conftest2.*
3876
+      if { { case "(($ac_try" in
3877
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3878
+  *) ac_try_echo=$ac_try;;
3879
+esac
3880
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3881
+$as_echo "$ac_try_echo"; } >&5
3882
+  (eval "$ac_try") 2>&5
3883
+  ac_status=$?
3884
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3885
+  test $ac_status = 0; } &&
3886
+	 test -f conftest2.$ac_objext && { { case "(($ac_try" in
3887
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3888
+  *) ac_try_echo=$ac_try;;
3889
+esac
3890
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3891
+$as_echo "$ac_try_echo"; } >&5
3892
+  (eval "$ac_try") 2>&5
3893
+  ac_status=$?
3894
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3895
+  test $ac_status = 0; };
3896
+      then
3897
+	# cc works too.
3898
+	:
3899
+      else
3900
+	# cc exists but doesn't like -o.
3901
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
3902
+      fi
3903
+    fi
3904
+  fi
3905
+else
3906
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
3907
+fi
3908
+rm -f core conftest*
3909
+
3910
+fi
3911
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
3912
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3913
+$as_echo "yes" >&6; }
3914
+else
3915
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3916
+$as_echo "no" >&6; }
3917
+
3918
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
3919
+
3920
+fi
3921
+
3922
+# FIXME: we rely on the cache variable name because
3923
+# there is no other way.
3924
+set dummy $CC
3925
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
3926
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
3927
+if test "$am_t" != yes; then
3928
+   # Losing compiler, so override with the script.
3929
+   # FIXME: It is wrong to rewrite CC.
3930
+   # But if we don't then we get into trouble of one sort or another.
3931
+   # A longer-term fix would be to have automake use am__CC in this case,
3932
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
3933
+   CC="$am_aux_dir/compile $CC"
3934
+fi
3935
+
3936
+
3811 3937
 
3812 3938
 # Checks for libraries.
3813 3939
 
... ...
@@ -6506,7 +6632,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
6506 6506
 # report actual input values of CONFIG_FILES etc. instead of their
6507 6507
 # values after options handling.
6508 6508
 ac_log="
6509
-This file was extended by makuosan $as_me 1.3.4, which was
6509
+This file was extended by makuosan $as_me 1.3.4.1, which was
6510 6510
 generated by GNU Autoconf 2.67.  Invocation command line was
6511 6511
 
6512 6512
   CONFIG_FILES    = $CONFIG_FILES
... ...
@@ -6576,7 +6702,7 @@ _ACEOF
6576 6576
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
6577 6577
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
6578 6578
 ac_cs_version="\\
6579
-makuosan config.status 1.3.4
6579
+makuosan config.status 1.3.4.1
6580 6580
 configured by $0, generated by GNU Autoconf 2.67,
6581 6581
   with options \\"\$ac_cs_config\\"
6582 6582
 
... ...
@@ -2,13 +2,14 @@
2 2
 # Process this file with autoconf to produce a configure script.
3 3
 
4 4
 AC_PREREQ([2.67])
5
-AC_INIT(makuosan, 1.3.4, info-makuosan@klab.jp)
5
+AC_INIT(makuosan, 1.3.4.1, info-makuosan@klab.jp)
6 6
 AM_INIT_AUTOMAKE
7 7
 AC_CONFIG_SRCDIR([common.c])
8 8
 AC_CONFIG_HEADERS([config.h])
9 9
 
10 10
 # Checks for programs.
11 11
 AC_PROG_CC
12
+AM_PROG_CC_C_O
12 13
 
13 14
 # Checks for libraries.
14 15
 AC_CHECK_LIB(crypto, MD5_Init)
... ...
@@ -181,6 +181,7 @@ void lprintf(int l, char *fmt, ...)
181 181
 
182 182
 int cprintf(int l, mcomm *c, char *fmt, ...)
183 183
 {
184
+  int i;
184 185
   int n;
185 186
   char m[2048];
186 187
   va_list arg;
... ...
@@ -203,9 +204,17 @@ int cprintf(int l, mcomm *c, char *fmt, ...)
203 203
     fsync(c->fd[0]);
204 204
     c->logfail = 0;
205 205
   }else{
206
+    for(i=0;i<sizeof(m);i++){
207
+      if(m[i] == 0){
208
+        break;
209
+      }
210
+      if(m[i] == '\n'){
211
+        m[i] = ' ';
212
+      }
213
+    }
206 214
     c->logover++;
207 215
     c->logfail = 1;
208
-    lprintf(0, "[error] %s: Resource temporarily unavailable: %s", __func__, m);
216
+    lprintf(0, "[error] %s: Resource temporarily unavailable: %s\n", __func__, m);
209 217
     return(-1);
210 218
   }
211 219
   return(0);