Skip to content
Snippets Groups Projects
Commit 771b7ee4 authored by Raymond Toy's avatar Raymond Toy
Browse files

Fix more compiler warnings.

Linux-os.c:
o Fix warning about pointer to int warning.

lisp.c:
o Linux needs time.h to define tzset.
o Fix warning about unused result from getwcd.  If getcwd fails, we
  now just exit with a message because we can't find anything.
parent f1874509
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ int personality (unsigned long);
#endif
void
check_personality(struct utsname *name, const char *argv[], const char *envp[])
check_personality(struct utsname *name, char *const *argv, char *const *envp)
{
/* KLUDGE: Disable memory randomization on new Linux kernels
* by setting a personality flag and re-executing. (We need
......@@ -428,7 +428,7 @@ sigsegv_handler(HANDLER_ARGS)
tramp_signal = signal;
tramp_code = *code;
tramp_context = *context;
SC_PC(context) = sigsegv_handler_tramp;
SC_PC(context) = (unsigned long) sigsegv_handler_tramp;
return;
}
#endif
......
......@@ -40,6 +40,10 @@
#include <sys/utsname.h>
#endif
#if defined(__linux__)
#include <time.h>
#endif
/* SIGINT handler that invokes the monitor. */
......@@ -94,6 +98,16 @@ static char *cmucllib_search_list[] = {
NULL
};
void
getcwd_or_die(char* buf, size_t size)
{
char *result = getcwd(buf, size);
if (result == NULL) {
perror("Cannot get cwd");
exit(1);
}
}
/* Set this to see how we're doing our search */
int debug_lisp_search = FALSE;
......@@ -154,7 +168,7 @@ default_cmucllib(const char *argv0arg)
* append argv[0], after stripping off the executable name.
*/
cwd = malloc(FILENAME_MAX + strlen(argv0_dir) + 100);
getcwd(cwd, FILENAME_MAX);
getcwd_or_die(cwd, FILENAME_MAX);
strcat(cwd, "/");
if (*argv0_dir != '\0') {
strcat(cwd, argv0_dir);
......@@ -353,7 +367,7 @@ prepend_core_path(const char *lib, const char *corefile)
* We have a relative path for the corefile. Prepend our current
* directory to get the full path.
*/
getcwd(cwd, FILENAME_MAX);
getcwd_or_die(cwd, FILENAME_MAX);
path = malloc(FILENAME_MAX + strlen(corefile) + 2);
strcpy(path, cwd);
strcat(path, "/");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment