+
+ if (strchr(filename, '/') != NULL) {
+ path = realpath(filename, fullpath);
+ if (path == NULL) {
+ /* Failed to resolve. */
+ return -1;
+ }
+ if (!is_there(path)) {
+ return -1;
+ }
+ } else {
+ path = g_find_program_in_path(filename);
+ if (path == NULL) {
+ return -1;
+ }
+ }
+
+ retval = open(path, O_RDONLY);