]> oss.titaniummirror.com Git - repo_shell.git/commitdiff
Remove unused code
authorR. Steve McKown <rsmckown@gmail.com>
Mon, 24 Sep 2012 14:18:34 +0000 (08:18 -0600)
committerR. Steve McKown <rsmckown@gmail.com>
Mon, 24 Sep 2012 14:18:34 +0000 (08:18 -0600)
repo_shell.c

index ecce7d3aebc8229f6bbee4e3cfe3ed7bc0ead514..f92ce6ef1c804084e88f96f4d52c5b69557e0a83 100644 (file)
@@ -32,27 +32,7 @@ static cfg_t cfg {
 static cfg_t cfg;
 #endif
 
-#define alloc_nr(x) (((x)+16)*3/2)
-
-/*
- * Realloc the buffer pointed at by variable 'x' so that it can hold
- * at least 'nr' entries; the number of entries currently allocated
- * is 'alloc', using the standard growing factor alloc_nr() macro.
- *
- * DO NOT USE any expression with side-effect for 'x', 'nr', or 'alloc'.
- */
-#define ALLOC_GROW(x, nr, alloc) \
-       do { \
-               if ((nr) > alloc) { \
-                       if (alloc_nr(alloc) < (nr)) \
-                               alloc = (nr); \
-                       else \
-                               alloc = alloc_nr(alloc); \
-                       x = xrealloc((x), alloc * sizeof(*(x))); \
-               } \
-       } while (0)
-
-static inline void die(const char *fmt, ...)
+static void die(const char *fmt, ...)
 {
        va_list ap;
 
@@ -84,18 +64,6 @@ void *xmalloc(size_t size)
        return ret;
 }
 
-void *xrealloc(void *ptr, size_t size)
-{
-       void *ret;
-
-       ret = realloc(ptr, size);
-       if (!ret && !size)
-               ret = realloc(ptr, 1);
-       if (!ret)
-               die("Out of memory, realloc failed");
-       return ret;
-}
-
 static uid_t user_uid(char *user)
 {
        struct passwd *pw = getpwnam(user);
@@ -157,6 +125,7 @@ static int git_acl(const char *user, const char *repo)
         * access, a return of 1 means read only, and a return of 2 means
         * read/write.
         */
+#if 0
        struct passwd *pw;
        char *file;
        int len = strlen(cfg.owner) + strlen(GIT_ACL_FILE) + 8;
@@ -167,8 +136,9 @@ static int git_acl(const char *user, const char *repo)
        len = strlen(pw->pw_dir) + strlen(GIT_ACL_FILE) + 2;
        file = xmalloc(sizeof(char) * len);
        sprintf(file, "%s/%s", pw->pw_dir, GIT_ACL_FILE);
-       fprintf(stderr, "[someday check %s]\n", file);
+       fprintf(stderr, "[someday check %s for git ACLs]\n", file);
        free(file);
+#endif
        return 2; /* assume read/write for now */
 }