TEXTCLIENT: getutline also belongs to the textclient. Tnx to Lightspeed for pointing...
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 24 Jul 2012 19:50:39 +0000 (21:50 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 24 Jul 2012 19:50:39 +0000 (21:50 +0200)
citadel/Makefile.in
citadel/configure.ac
citadel/getutline.c [deleted file]
textclient/Makefile.in
textclient/src/getutline.c [new file with mode: 0644]

index b855fae7c43d05d7990a21eeeccf817ed0035b87..e6018be85b5b0346b9450a3d138406ba74d2e072 100644 (file)
@@ -78,7 +78,7 @@ SOURCES=utils/aidepost.c utils/citmail.c \
        utils/ctdlmigrate.c utils/base64.c utils/chkpwd.c \
        utillib/citadel_dirs.c \
        citserver.c clientsocket.c config.c control.c $(DATABASE) \
-       domain.c serv_extensions.c file_ops.c genstamp.c getutline.c \
+       domain.c serv_extensions.c file_ops.c genstamp.c \
        housekeeping.c ical_dezonify.c internet_addressing.c ecrash.c \
        locate_host.c md5.c auth.c msgbase.c parsedate.c \
        room_ops.c euidindex.c server_main.c snprintf.c ldap.c \
index 41c00e0d9d44e212d5c0e1dae7ddd6d4d16b296f..c140e7640f65e467b26b5d217e05331d978f80fa 100644 (file)
@@ -990,8 +990,6 @@ if test "$ac_cv_func_pthread_create" = yes; then
        test "$DATABASE" && TARGETS="server utils"
 fi
 
-AC_REPLACE_FUNCS(snprintf getutline)
-
 AC_CACHE_CHECK([the weather], ac_cv_weather, [
        sleep 1
        echo $ECHO_N "opening your window... $ECHO_C" >&6
diff --git a/citadel/getutline.c b/citadel/getutline.c
deleted file mode 100644 (file)
index 7c6b78e..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * getutline.c: not-quite-compatible replacement for getutline(3)
- * by nathan bryant, feb 1999
- */
-
-#include "sysdep.h"
-#ifdef HAVE_UTMP_H
-#include <stdio.h>
-#include <sys/types.h>
-#include <utmp.h>
-#ifdef HAVE_PATHS_H
-#include <paths.h>
-#endif
-#include <string.h>
-
-struct utmp *getutline(struct utmp *ut)
-{
-  static struct utmp retval;
-  FILE *utmp;
-
-#ifdef UTMP_FILE
-  if ((utmp = fopen(UTMP_FILE, "rb")) == NULL)
-#else
-  if ((utmp = fopen(_PATH_UTMP, "rb")) == NULL)
-#endif
-    return NULL;
-
-  do
-    if (!fread(&retval, sizeof retval, 1, utmp))
-      {
-       fclose(utmp);
-       return NULL;
-      }
-  while (strcmp(ut->ut_line, retval.ut_line));
-
-  fclose(utmp);
-  return &retval;
-}
-#endif /* HAVE_UTMP_H */
index a10ed3fd487327c52bc523058b6c1e70563ed8d3..12a9372e5cc9409b0b7933722b384aef8d28200b 100644 (file)
@@ -72,6 +72,7 @@ SOURCES=src/client_chat.c \
        src/citadel_ipc.c \
        src/ecrash.c \
        src/ipc_c_tcp.c \
+       src/getutline.c \
        src/screen.c
 
 # for VPATH builds (invoked by configure)
diff --git a/textclient/src/getutline.c b/textclient/src/getutline.c
new file mode 100644 (file)
index 0000000..7c6b78e
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * getutline.c: not-quite-compatible replacement for getutline(3)
+ * by nathan bryant, feb 1999
+ */
+
+#include "sysdep.h"
+#ifdef HAVE_UTMP_H
+#include <stdio.h>
+#include <sys/types.h>
+#include <utmp.h>
+#ifdef HAVE_PATHS_H
+#include <paths.h>
+#endif
+#include <string.h>
+
+struct utmp *getutline(struct utmp *ut)
+{
+  static struct utmp retval;
+  FILE *utmp;
+
+#ifdef UTMP_FILE
+  if ((utmp = fopen(UTMP_FILE, "rb")) == NULL)
+#else
+  if ((utmp = fopen(_PATH_UTMP, "rb")) == NULL)
+#endif
+    return NULL;
+
+  do
+    if (!fread(&retval, sizeof retval, 1, utmp))
+      {
+       fclose(utmp);
+       return NULL;
+      }
+  while (strcmp(ut->ut_line, retval.ut_line));
+
+  fclose(utmp);
+  return &retval;
+}
+#endif /* HAVE_UTMP_H */