1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

code cleanup (mainly removed line spaces at the beginning of lines by tabulations)

This commit is contained in:
Aurelien Foret 2006-01-07 09:42:48 +00:00
parent 6c3657b702
commit f3a4197e34
10 changed files with 54 additions and 45 deletions

View File

@ -328,8 +328,10 @@ int _alpm_log_action(unsigned char usesyslog, FILE *f, char *fmt, ...)
t = time(NULL);
tm = localtime(&t);
fprintf(f, "[%02d/%02d/%02d %02d:%02d] %s\n", tm->tm_mon+1, tm->tm_mday,
tm->tm_year-100, tm->tm_hour, tm->tm_min, msg);
fprintf(f, "[%02d/%02d/%02d %02d:%02d] %s\n",
tm->tm_mon+1, tm->tm_mday, tm->tm_year-100,
tm->tm_hour, tm->tm_min,
msg);
}
return(0);

View File

@ -79,7 +79,6 @@ int rmrf(char *path)
int errflag = 0;
struct dirent *dp;
DIR *dirp;
char name[PATH_MAX];
if(!unlink(path)) {
return(0);
@ -102,6 +101,7 @@ int rmrf(char *path)
}
for(dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
if(dp->d_ino) {
char name[PATH_MAX];
sprintf(name, "%s/%s", path, dp->d_name);
if(strcmp(dp->d_name, "..") && strcmp(dp->d_name, ".")) {
errflag += rmrf(name);

View File

@ -21,10 +21,17 @@
#ifndef _PM_UTIL_H
#define _PM_UTIL_H
#define MALLOC(p, b) do { if((b) > 0) { \
p = malloc(b); if (!(p)) { \
#define MALLOC(p, b) do { \
if((b) > 0) { \
p = malloc(b); \
if (!(p)) { \
fprintf(stderr, "malloc failure: could not allocate %d bytes\n", b); \
exit(1); }} else p = NULL; } while(0)
exit(1); \
} \
} else { \
p = NULL; \
} \
} while(0)
#define FREE(p) do { if (p) { free(p); (p) = NULL; }} while(0)