Changeset f77c1c9 in mainline for uspace/lib/c/generic/loader.c


Ignore:
Timestamp:
2017-12-08T21:03:35Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c19a5a59
Parents:
c1694b6b
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-07 19:44:55)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 21:03:35)
Message:

Return VFS handles separately from error codes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/loader.c

    rc1694b6b rf77c1c9  
    5252 * @param name Symbolic name to set on the newly created task.
    5353 *
    54  * @return Pointer to the loader connection structure (should be
    55  *         deallocated using free() after use).
    56  *
     54 * @return Error code.
    5755 */
    5856int loader_spawn(const char *name)
     
    198196        }
    199197       
    200         int fd = vfs_lookup(path, 0);
    201         if (fd < 0) {
    202                 return fd;
    203         }
    204        
    205         int rc = loader_set_program(ldr, name, fd);
     198        int fd;
     199        int rc = vfs_lookup(path, 0, &fd);
     200        if (rc != EOK) {
     201                return rc;
     202        }
     203       
     204        rc = loader_set_program(ldr, name, fd);
    206205        vfs_put(fd);
    207206        return rc;
Note: See TracChangeset for help on using the changeset viewer.