diff lib/protocols.c @ 14:83090328581e

* More largefile support. Hopefully all that is left is the configure stuff * Sanity checking on the fdopen() calls. Also make sure that all of them have a + in their open mode. Doesn't affect UNIX, but it does affect Windows * HTTP fixes when running under Solaris. Read from request->sockfd and write to request->sockfd_write (Solaris doesn't like it when you read/write to the same FILE structure) * Display major/minor properly for a device when connected with the local protocol
author masneyb
date Wed, 04 Sep 2002 11:45:56 +0000
parents 5551ab2301fe
children ddb983d8574b
line wrap: on
line diff
--- a/lib/protocols.c	Fri Aug 30 19:46:27 2002 +0000
+++ b/lib/protocols.c	Wed Sep 04 11:45:56 2002 +0000
@@ -1038,8 +1038,7 @@
 parse_time (char **str)
 {
   const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
-    "Aug", "Sep", "Oct", "Nov", "Dec"
-  };
+    "Aug", "Sep", "Oct", "Nov", "Dec" };
   char *startpos, *endpos, *datepos;
   struct tm curtime, tt;
   time_t t;
@@ -1245,7 +1244,7 @@
   /* See if this is a block or character device. We will store the major number
      in the high word and the minor number in the low word.  */
   if ((fle->attribs[0] == 'b' || fle->attribs[0] == 'u' || 
-       fle->attribs[0] == 'c') && 
+       fle->attribs[0] == 'c') &&
       ((endpos = strchr (startpos, ',')) != NULL))
     {
       fle->size = strtol (startpos, NULL, 10) << 16;
@@ -1257,7 +1256,7 @@
       /* Get the minor number */
       if ((endpos = strchr (startpos, ' ')) == NULL)
 	return (-2);
-      fle->size |= strtol (startpos, NULL, 10);
+      fle->size |= strtol (startpos, NULL, 10) & 0xFF;
     }
   else
     {
@@ -1920,7 +1919,12 @@
   for (templist = list; ; templist = templist->next)
     {
       tempfle = templist->data;
-      printf ("%s:%s:%ld:%ld:%s:%s:%s\n", tempfle->file, tempfle->destfile,
+#if defined (_LARGEFILE_SOURCE)
+      printf ("%s:%s:%lld:%lld:%s:%s:%s\n", 
+#else
+      printf ("%s:%s:%ld:%ld:%s:%s:%s\n", 
+#endif
+              tempfle->file, tempfle->destfile,
               tempfle->size, tempfle->startsize, tempfle->user, tempfle->group,
               tempfle->attribs);
       if (templist->next == NULL)
@@ -1931,7 +1935,12 @@
   for (; ; templist = templist->prev)
     {
       tempfle = templist->data;
-      printf ("%s:%s:%ld:%ld:%s:%s:%s\n", tempfle->file, tempfle->destfile,
+#if defined (_LARGEFILE_SOURCE)
+      printf ("%s:%s:%lld:%lld:%s:%s:%s\n", 
+#else
+      printf ("%s:%s:%ld:%ld:%s:%s:%s\n", 
+#endif
+              tempfle->file, tempfle->destfile,
               tempfle->size, tempfle->startsize, tempfle->user, tempfle->group,
               tempfle->attribs);
       if (templist == list)