X-Git-Url: https://www.flypig.org.uk/git/?a=blobdiff_plain;f=src%2Fshared.c;h=f4c76f97cb5c3041c8202afe3d5fb120d2298c04;hb=96f2ade4bbf76f083b2039a99e3452053817909f;hp=86ddc01e551e7927291fb5350a65da8b774bdf3a;hpb=204333885950fa798a491dcdf141f2e928dd497d;p=hashcat.git diff --git a/src/shared.c b/src/shared.c index 86ddc01..f4c76f9 100644 --- a/src/shared.c +++ b/src/shared.c @@ -6,7 +6,7 @@ * License.....: MIT */ -#ifdef DARWIN +#ifdef __APPLE__ #include #endif @@ -2387,7 +2387,7 @@ int tty_fix() } #endif -#if defined(DARWIN) || defined(__FreeBSD__) +#if defined(__APPLE__) || defined(__FreeBSD__) static struct termios savemodes; static int havemodes = 0; @@ -4365,7 +4365,7 @@ char *get_exec_path () const int len = GetModuleFileName (NULL, exec_path, exec_path_len - 1); - #elif DARWIN + #elif __APPLE__ uint size = exec_path_len; @@ -4519,7 +4519,7 @@ void truecrypt_crc32 (const char *filename, u8 keytab[64]) myfree (buf); } -#ifdef DARWIN +#ifdef __APPLE__ int pthread_setaffinity_np (pthread_t thread, size_t cpu_size, cpu_set_t *cpu_set) { int core; @@ -5794,11 +5794,14 @@ char **scan_directory (const char *path) if ((d = opendir (tmp_path)) != NULL) { - #ifdef DARWIN + #ifdef __APPLE__ + struct dirent e; - for (;;) { + for (;;) + { memset (&e, 0, sizeof (e)); + struct dirent *de = NULL; if (readdir_r (d, &e, &de) != 0) @@ -5809,12 +5812,16 @@ char **scan_directory (const char *path) } if (de == NULL) break; + #else + struct dirent *de; while ((de = readdir (d)) != NULL) { + #endif + if ((strcmp (de->d_name, ".") == 0) || (strcmp (de->d_name, "..") == 0)) continue; int path_size = strlen (tmp_path) + 1 + strlen (de->d_name);