Fixed build
authorAnas Nashif <anas.nashif@intel.com>
Fri, 22 Feb 2013 15:41:23 +0000 (07:41 -0800)
committerAnas Nashif <anas.nashif@intel.com>
Fri, 22 Feb 2013 15:41:23 +0000 (07:41 -0800)
libedsio/edsio.c
xdelta.m4
xdmain.c

index 4d110f6..1c445fb 100755 (executable)
@@ -296,7 +296,7 @@ edsio_time_of_day (SerialGenericTime* setme)
   struct timeval tv;
   time_t t = time (NULL);
 
-  if (t < 0)
+  if (t == ((time_t)-1))
     {
       edsio_generate_errno_event (EC_EdsioTimeFailure);
       goto bail;
index 5a0dc11..5ffaf73 100755 (executable)
--- a/xdelta.m4
+++ b/xdelta.m4
@@ -4,7 +4,7 @@
 dnl AM_PATH_XDELTA([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 dnl Test for XDELTA, and define XDELTA_CFLAGS and XDELTA_LIBS, if "gmodule" or
 dnl
-AC_DEFUN(AM_PATH_XDELTA,
+AC_DEFUN([AM_PATH_XDELTA],
 [dnl
 dnl Get the cflags and libraries from the xdelta-config script
 dnl
index b1abc74..db801ff 100755 (executable)
--- a/xdmain.c
+++ b/xdmain.c
@@ -1063,7 +1063,7 @@ xd_handle_read (XdFileHandle *fh, guint8 *buf, gsize nbyte)
 
   if (! (fh->in_read) (fh, buf, nbyte)) /* This is suspicious */
     {
-      xd_error ("read failed: %s\n", g_strerror (errno));
+      xd_error ("read failed: %s\n", errno?g_strerror (errno):"Unexpected end of file");
       return -1;
     }
 
@@ -1225,7 +1225,7 @@ static gssize
 xd_handle_map_page (XdFileHandle *fh, guint pgno, const guint8** mem)
 {
   LRU* lru;
-  guint to_map;
+  gint to_map;
 
 #ifdef DEBUG_MAP
   g_print ("map %p:%d\n", fh, pgno);
@@ -1299,7 +1299,7 @@ xd_handle_map_page (XdFileHandle *fh, guint pgno, const guint8** mem)
              return -1;
            }
 #else
-         if (! (lru->buffer = mmap (NULL, to_map, PROT_READ, MAP_PRIVATE, fh->fd, pgno * XD_PAGE_SIZE)))
+         if ( (lru->buffer = mmap (NULL, to_map, PROT_READ, MAP_PRIVATE, fh->fd, pgno * XD_PAGE_SIZE)) == MAP_FAILED )
            {
              xd_error ("mmap failed: %s\n", g_strerror (errno));
              return -1;
@@ -1504,7 +1504,7 @@ delta_command (gint argc, gchar** argv)
   XdeltaSource* src;
   XdeltaControl* cont;
   gboolean from_is_compressed = FALSE, to_is_compressed = FALSE;
-  guint32 control_offset, header_offset;
+  gint32 control_offset, header_offset;
   const char* from_name, *to_name;
   guint32 header_space[HEADER_WORDS];
   int fd;