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;
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);
* 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;
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 */
}