Subversion Repositories HelenOS

Rev

Rev 3397 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3397 Rev 3492
Line 44... Line 44...
44
#include "util.h"
44
#include "util.h"
45
#include "exec.h"
45
#include "exec.h"
46
#include "errors.h"
46
#include "errors.h"
47
 
47
 
48
/* FIXME: Just have find_command() return an allocated string */
48
/* FIXME: Just have find_command() return an allocated string */
49
char *found;
49
static char *found;
50
 
50
 
51
static char *find_command(char *);
51
static char *find_command(char *);
52
static unsigned int try_access(const char *);
52
static int try_access(const char *);
53
 
53
 
54
/* work-around for access() */
54
/* work-around for access() */
55
static unsigned int try_access(const char *f)
55
static int try_access(const char *f)
56
{
56
{
57
    int fd;
57
    int fd;
58
 
58
 
59
    fd = open(f, O_RDONLY);
59
    fd = open(f, O_RDONLY);
60
    if (fd > -1) {
60
    if (fd > -1) {
Line 115... Line 115...
115
    char *tmp;
115
    char *tmp;
116
 
116
 
117
    tmp = cli_strdup(find_command(cmd));
117
    tmp = cli_strdup(find_command(cmd));
118
    free(found);
118
    free(found);
119
 
119
 
120
    tid = task_spawn((const char *)tmp, (const char **)argv);
120
    tid = task_spawn((const char *)tmp, argv);
121
    free(tmp);
121
    free(tmp);
122
 
122
 
123
    if (tid == 0) {
123
    if (tid == 0) {
124
        cli_error(CL_EEXEC, "Can not spawn %s", cmd);
124
        cli_error(CL_EEXEC, "Can not spawn %s", cmd);
125
        return 1;
125
        return 1;