aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/test_gnunet_prefix.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/contrib/test_gnunet_prefix.c b/contrib/test_gnunet_prefix.c
index 1a3c9a7ba..b27ef0b2d 100644
--- a/contrib/test_gnunet_prefix.c
+++ b/contrib/test_gnunet_prefix.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -28,8 +28,7 @@
28 28
29 29
30int 30int
31main (int argc, 31main (int argc, char **argv)
32 char **argv)
33{ 32{
34 const char *basename; 33 const char *basename;
35 const char *dirname; 34 const char *dirname;
@@ -37,27 +36,27 @@ main (int argc,
37 basename = getenv ("GNUNET_PREFIX"); 36 basename = getenv ("GNUNET_PREFIX");
38 if (NULL == basename) 37 if (NULL == basename)
39 { 38 {
40 fprintf (stderr, 39 fprintf (stderr, _ ("Environment variable GNUNET_PREFIX not set\n"));
41 _("Environment variable GNUNET_PREFIX not set\n")); 40 fprintf (stderr, _ ("Testcases will not work!\n"));
42 fprintf (stderr,
43 _("Testcases will not work!\n"));
44 return 1; 41 return 1;
45 } 42 }
46 dirname = DIR_SEPARATOR_STR ".." DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR "config.d"; 43 dirname = DIR_SEPARATOR_STR ".." DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR
44 "gnunet" DIR_SEPARATOR_STR "config.d";
47 { 45 {
48 char tmp[strlen (basename) + strlen (dirname) + 1]; 46 char tmp[strlen (basename) + strlen (dirname) + 1];
49 sprintf (tmp, "%s%s", basename, dirname); 47 sprintf (tmp, "%s%s", basename, dirname);
50 if (0 != access (tmp, R_OK)) 48 if (0 != access (tmp, R_OK))
51 { 49 {
52 fprintf (stderr, 50 fprintf (stderr,
53 _("Failed to access `%s': %s\n"), 51 _ ("Failed to access `%s': %s\n"),
54 tmp, 52 tmp,
55 STRERROR (errno)); 53 STRERROR (errno));
56 fprintf (stderr, 54 fprintf (
57 _("Check that you did run `make install' and that GNUNET_PREFIX='%s' is the correct prefix.\n"), 55 stderr,
58 basename); 56 _ (
59 fprintf (stderr, 57 "Check that you did run `make install' and that GNUNET_PREFIX='%s' is the correct prefix.\n"),
60 _("Testcases will not work!\n")); 58 basename);
59 fprintf (stderr, _ ("Testcases will not work!\n"));
61 return 2; 60 return 2;
62 } 61 }
63 } 62 }