Don't try and create symbolic links on platforms that don't support symlink()
authorJ. Ali Harlow <ali@juiblex.co.uk>
Thu, 8 Jan 2009 13:51:07 +0000 (13:51 +0000)
committerJ. Ali Harlow <ali@juiblex.co.uk>
Thu, 8 Jan 2009 13:51:07 +0000 (13:51 +0000)
configure.ac
librazor/rpm.c

index 6167d06..cb56d56 100644 (file)
@@ -24,6 +24,7 @@ AM_PROG_CC_STDC
 AC_HEADER_STDC
 AC_CHECK_HEADERS([sys/mman.h])
 gl_INIT
+AC_CHECK_FUNCS([symlink])
 AM_PROG_LIBTOOL
 AC_PROG_MAKE_SET
 AC_PROG_LN_S
index f4cbf71..c4eafb9 100644 (file)
@@ -17,6 +17,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#include "config.h"
+
 #include <stdio.h>
 #include <stddef.h>
 #include <stdlib.h>
@@ -530,13 +532,8 @@ create_path(struct installer *installer, const char *path, unsigned int mode)
                        return -1;
                }
                return 0;
-       case PIPE:
-       case CDEV:
-       case BDEV:
-       case SOCK:
-               printf("%s: unhandled file type %d\n", buffer, mode >> 12);
-               return 0;
        case LINK:
+#if HAVE_SYMLINK
                if (installer_inflate(installer)) {
                        fprintf(stderr, "failed to inflate\n");
                        return -1;
@@ -551,6 +548,15 @@ create_path(struct installer *installer, const char *path, unsigned int mode)
                        return -1;
                }
                return 0;
+#else
+               /* fall through */
+#endif
+       case PIPE:
+       case CDEV:
+       case BDEV:
+       case SOCK:
+               printf("%s: unhandled file type %d\n", buffer, mode >> 12);
+               return 0;
        default:
                printf("%s: unknown file type %d\n", buffer, mode >> 12);
                return 0;