src/filesystem/unix/SDL_sysfilesystem.c
changeset 7668 66da4242ce53
parent 7667 be1cc6f55840
child 7692 e1036c58fac7
     1.1 --- a/src/filesystem/unix/SDL_sysfilesystem.c	Tue Aug 20 19:57:11 2013 -0400
     1.2 +++ b/src/filesystem/unix/SDL_sysfilesystem.c	Tue Aug 20 20:15:15 2013 -0400
     1.3 @@ -26,12 +26,15 @@
     1.4  /* System dependent filesystem routines                                */
     1.5  
     1.6  #include <unistd.h>
     1.7 +#include <sys/stat.h>
     1.8 +#include <sys/types.h>
     1.9  
    1.10  #include "SDL_error.h"
    1.11  #include "SDL_stdinc.h"
    1.12  #include "SDL_filesystem.h"
    1.13  
    1.14 -static char *readSymLink(const char *path)
    1.15 +static char *
    1.16 +readSymLink(const char *path)
    1.17  {
    1.18      char *retval = NULL;
    1.19      ssize_t len = 64;
    1.20 @@ -71,7 +74,7 @@
    1.21      char *retval = NULL;
    1.22  
    1.23      /* is a Linux-style /proc filesystem available? */
    1.24 -    if (access("/proc", F_OK) {
    1.25 +    if (access("/proc", F_OK) == 0) {
    1.26          retval = readSymLink("/proc/self/exe");
    1.27          if (retval == NULL) {
    1.28              /* older kernels don't have /proc/self ... try PID version... */