/[hurd]/hurd/exec/hashexec.c
ViewVC logotype

Diff of /hurd/exec/hashexec.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.32 by thomas, Thu Jul 20 19:40:47 2000 UTC revision 1.33 by roland, Wed May 29 08:48:35 2002 UTC
# Line 1  Line 1 
1  /* GNU Hurd standard exec server, #! script execution support.  /* GNU Hurd standard exec server, #! script execution support.
2     Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.     Copyright (C) 1995,96,97,98,99,2000,02 Free Software Foundation, Inc.
3     Written by Roland McGrath.     Written by Roland McGrath.
4    
5  This file is part of the GNU Hurd.  This file is part of the GNU Hurd.
# Line 230  check_hashbang (struct execdata *e, Line 230  check_hashbang (struct execdata *e,
230                char *name;                char *name;
231                int free_name = 0; /* True if we should free NAME. */                int free_name = 0; /* True if we should free NAME. */
232                file_t name_file;                file_t name_file;
233                mach_port_t fileid;                mach_port_t fileid, filefsid;
               dev_t filedev;  
234                ino_t fileno;                ino_t fileno;
235    
236                /* Search $PATH for NAME, opening a port NAME_FILE on it.                /* Search $PATH for NAME, opening a port NAME_FILE on it.
# Line 261  check_hashbang (struct execdata *e, Line 260  check_hashbang (struct execdata *e,
260                    return err;                    return err;
261                  }                  }
262    
263                error = io_identity (file, &fileid, &filedev, &fileno);                error = io_identity (file, &fileid, &filefsid, &fileno);
264                if (error)                if (error)
265                  goto out;                  goto out;
266                  mach_port_deallocate (mach_task_self (), filefsid);
267    
268                if (memchr (argv, '\0', argvlen) == NULL)                if (memchr (argv, '\0', argvlen) == NULL)
269                  {                  {
# Line 284  check_hashbang (struct execdata *e, Line 284  check_hashbang (struct execdata *e,
284    
285                if (!error && name_file != MACH_PORT_NULL)                if (!error && name_file != MACH_PORT_NULL)
286                  {                  {
287                    mach_port_t id;                    mach_port_t id, fsid;
                   dev_t dev;  
288                    ino_t ino;                    ino_t ino;
289                    error = io_identity (name_file, &id, &dev, &ino);                    error = io_identity (name_file, &id, &fsid, &ino);
290                    mach_port_deallocate (mach_task_self (), id);                    mach_port_deallocate (mach_task_self (), name_file);
291                      if (!error)
292                        {
293                          mach_port_deallocate (mach_task_self (), fsid);
294                          mach_port_deallocate (mach_task_self (), id);
295                        }
296                    if (!error && id == fileid)                    if (!error && id == fileid)
297                      {                      {
298                        file_name = name;                        file_name = name;
# Line 296  check_hashbang (struct execdata *e, Line 300  check_hashbang (struct execdata *e,
300                      }                      }
301                    else if (free_name)                    else if (free_name)
302                      free (name);                      free (name);
                   mach_port_deallocate (mach_task_self (), name_file);  
303                  }                  }
304    
305                mach_port_deallocate (mach_task_self (), fileid);                mach_port_deallocate (mach_task_self (), fileid);

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26