]> git.pld-linux.org Git - packages/coreutils.git/commitdiff
- obsolete
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 27 Apr 2004 14:13:27 +0000 (14:13 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    coreutils-utmp.patch -> 1.3

coreutils-utmp.patch [deleted file]

diff --git a/coreutils-utmp.patch b/coreutils-utmp.patch
deleted file mode 100644 (file)
index 7f2d59f..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -Nur coreutils-4.5.9.orig/lib/readutmp.c coreutils-4.5.9/lib/readutmp.c
---- coreutils-4.5.9.orig/lib/readutmp.c        Sat Nov 17 14:29:42 2001
-+++ coreutils-4.5.9/lib/readutmp.c     Sun Oct 27 21:58:30 2002
-@@ -95,40 +96,31 @@
- }
- #else
-+#define UTMP_READ_INCR 128
- int
- read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
- {
--  FILE *utmp;
--  struct stat file_stats;
--  size_t n_read;
--  size_t size;
--  STRUCT_UTMP *buf;
--
--  utmp = fopen (filename, "r");
--  if (utmp == NULL)
--    return 1;
--
--  fstat (fileno (utmp), &file_stats);
--  size = file_stats.st_size;
--  if (size > 0)
--    buf = (STRUCT_UTMP *) xmalloc (size);
--  else
--    {
--      fclose (utmp);
--      return 1;
--    }
--
--  /* Use < instead of != in case the utmp just grew.  */
--  n_read = fread (buf, 1, size, utmp);
--  if (ferror (utmp) || fclose (utmp) == EOF
--      || n_read < size)
--    return 1;
-+    int n_read;
-+    STRUCT_UTMP *uptr;
--  *n_entries = size / sizeof (STRUCT_UTMP);
--  *utmp_buf = buf;
--
--  return 0;
-+    utmpname(filename);
-+    setutent();
-+    n_read = 0;
-+    utmp_contents = (STRUCT_UTMP *) xmalloc(UTMP_READ_INCR*sizeof(STRUCT_UTMP));
-+    while ((uptr=getutent())) {
-+      if (NULL == utmp_contents)
-+          break;  /* we do not have more memory here */
-+      memcpy(&utmp_contents[n_read], uptr, sizeof(STRUCT_UTMP));
-+      n_read++;
-+      if (0 == ( n_read % UTMP_READ_INCR ))
-+          utmp_contents = (STRUCT_UTMP *)
-+              xrealloc(utmp_contents,
-+                       (n_read + UTMP_READ_INCR) * sizeof(STRUCT_UTMP));
-+    }
-+   
-+    endutent();
-+    return n_read;
- }
- #endif
This page took 0.158663 seconds and 4 git commands to generate.