bugfix: cfs_open must get aquire permissions

This commit is contained in:
fros4943 2009-03-26 12:22:52 +00:00
parent 25cc327acc
commit 2e156afe2a

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: shell-exec.c,v 1.3 2008/08/21 19:15:41 nvt-se Exp $ * $Id: shell-exec.c,v 1.4 2009/03/26 12:22:52 fros4943 Exp $
*/ */
/** /**
@ -71,19 +71,18 @@ PROCESS_THREAD(shell_exec_process, ev, data)
autostart_exit(elfloader_autostart_processes); autostart_exit(elfloader_autostart_processes);
} }
fd = cfs_open(name, CFS_READ | CFS_WRITE);
fd = cfs_open(name, CFS_READ);
if(fd < 0) { if(fd < 0) {
shell_output_str(&exec_command, shell_output_str(&exec_command,
"exec: could not open ", name); "exec: could not open ", name);
} else { } else {
int ret; int ret;
char *print, *symbol; char *print, *symbol;
ret = elfloader_load(fd); ret = elfloader_load(fd);
cfs_close(fd); cfs_close(fd);
symbol = ""; symbol = "";
switch(ret) { switch(ret) {
case ELFLOADER_OK: case ELFLOADER_OK:
print = "OK"; print = "OK";
@ -127,7 +126,7 @@ PROCESS_THREAD(shell_exec_process, ev, data)
} }
} }
PROCESS_END(); PROCESS_END();
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/