src/xpath/xpath.c
/*
 * Get the current executable path.
 * (path should at least have size SIRI_PATH_MAX)
 *
 * Returns 0 if successful or -1 in case of an error.
 * (this functions writes logging in case of errors)
 */
Get the current executable path.
(path should at least have size SIRI_PATH_MAX)

Returns 0 if successful or -1 in case of an error.
(this functions writes logging in case of errors)
Get the current executable path . ( path should at least have size SIRI_PATH_MAX ) Returns 0 if successful or - 1 in case of an error . ( this functions writes logging in case of errors )
int xpath_get_exec_path(char * path)
{
    char* path_end;
    if (readlink("/proc/self/exe", path, SIRI_PATH_MAX) == -1)
    {
        log_critical("Cannot read executable path");
        return -1;
    }
    path_end = strrchr(path, '/');
    if (path_end == NULL)
    {
        log_critical("Cannot find / in executable path");
        return -1;
    }
    *(++path_end) = '\0';
    return 0;
}
int xpath_get_exec_path ( char * path ) { char * path_end ; if ( readlink ( " " , path , SIRI_PATH_MAX ) == -1 ) { log_critical ( " " ) ; return -1 ; } path_end = strrchr ( path , ' ' ) ; if ( path_end == NULL ) { log_critical ( " " ) ; return -1 ; } * ( ++ path_end ) = ' \0 ' ; return 0 ; }
Get the current executable path.
Get the current executable path .
/* find last / in path */