Indentation fix, cleanup.
[AROS.git] / arch / all-hosted / bootstrap / filesystem.c
blob6978a37b398286c00f8f0cad8eb10b0c62b1c321
1 /*
2 Copyright © 2010-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <dirent.h>
7 #include <sys/stat.h>
9 #ifdef _WIN32
10 #define APPNAME "AROSBootstrap.exe"
11 #else
12 #include <unistd.h>
13 #define APPNAME "AROSBootstrap"
14 #endif
16 #include "filesystem.h"
18 int SetRootDirectory(void)
20 struct stat st;
21 int i, ret;
24 * If AROSBootstrap.exe is found in the current directory, this means the bootstrap
25 * was started in its own dir. Go one or two levels up in order to reach the root.
27 if (!stat(APPNAME, &st))
29 for (i = 0; i < 2; i++)
31 ret = chdir("..");
32 if (ret)
33 return ret;
35 if (!stat("AROS.boot", &st))
36 break;
40 return 0;