mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
Update function check configure.ac
This commit is contained in:
parent
87251a991c
commit
0ea74e5c7f
3 changed files with 10 additions and 9 deletions
|
@ -82,7 +82,6 @@ dnl ---------------------------------------------------------------------
|
||||||
AC_CHECK_FUNC([getline],, AC_MSG_ERROR("Could not find getline in c library"))
|
AC_CHECK_FUNC([getline],, AC_MSG_ERROR("Could not find getline in c library"))
|
||||||
AC_CHECK_FUNC([open],, AC_MSG_ERROR("Could not find open in c library"))
|
AC_CHECK_FUNC([open],, AC_MSG_ERROR("Could not find open in c library"))
|
||||||
AC_CHECK_FUNC([sysconf],, AC_MSG_ERROR("Could not find sysconf"))
|
AC_CHECK_FUNC([sysconf],, AC_MSG_ERROR("Could not find sysconf"))
|
||||||
AC_CHECK_FUNC([getenv],, AC_MSG_ERROR("Could not find getenv"))
|
|
||||||
AC_CHECK_FUNC([strtok_r],, AC_MSG_ERROR("Could not find strtok_r"))
|
AC_CHECK_FUNC([strtok_r],, AC_MSG_ERROR("Could not find strtok_r"))
|
||||||
AC_CHECK_FUNC([flock],, AC_MSG_ERROR("Could not find flock"))
|
AC_CHECK_FUNC([flock],, AC_MSG_ERROR("Could not find flock"))
|
||||||
AC_CHECK_FUNC([ftruncate],,AC_MSG_ERROR("Could not find ftruncate"))
|
AC_CHECK_FUNC([ftruncate],,AC_MSG_ERROR("Could not find ftruncate"))
|
||||||
|
@ -91,7 +90,8 @@ AC_CHECK_FUNC([setlocale],,AC_MSG_ERROR("Could not find setlocale"))
|
||||||
AC_CHECK_FUNC([atexit],, AC_MSG_ERROR("Could not find atexit in c library"))
|
AC_CHECK_FUNC([atexit],, AC_MSG_ERROR("Could not find atexit in c library"))
|
||||||
|
|
||||||
AC_CHECK_HEADER([math.h],, AC_MSG_ERROR("Could not find math.h header file"))
|
AC_CHECK_HEADER([math.h],, AC_MSG_ERROR("Could not find math.h header file"))
|
||||||
AC_SEARCH_LIBS([asin],[m],, AC_MSG_ERROR("Could not find asin in math library"))
|
AC_SEARCH_LIBS([floor],[m],, AC_MSG_ERROR("Could not find floor in math library"))
|
||||||
|
AC_SEARCH_LIBS([ceil], [m],, AC_MSG_ERROR("Could not find ceil in math library"))
|
||||||
|
|
||||||
dnl ---------------------------------------------------------------------
|
dnl ---------------------------------------------------------------------
|
||||||
dnl Check dependencies
|
dnl Check dependencies
|
||||||
|
|
|
@ -138,7 +138,7 @@ static void delete_ssh ( const char *host )
|
||||||
*/
|
*/
|
||||||
static char **read_known_hosts_file ( char ** retv, unsigned int *length )
|
static char **read_known_hosts_file ( char ** retv, unsigned int *length )
|
||||||
{
|
{
|
||||||
char *path = g_build_filename ( g_getenv ( "HOME" ), ".ssh", "known_hosts", NULL );
|
char *path = g_build_filename ( g_get_home_dir (), ".ssh", "known_hosts", NULL );
|
||||||
FILE *fd = fopen ( path, "r" );
|
FILE *fd = fopen ( path, "r" );
|
||||||
if ( fd != NULL ) {
|
if ( fd != NULL ) {
|
||||||
char *buffer = NULL;
|
char *buffer = NULL;
|
||||||
|
@ -267,7 +267,7 @@ static char ** get_ssh ( unsigned int *length )
|
||||||
unsigned int num_favorites = 0;
|
unsigned int num_favorites = 0;
|
||||||
char *path;
|
char *path;
|
||||||
|
|
||||||
if ( getenv ( "HOME" ) == NULL ) {
|
if ( g_get_home_dir () == NULL ) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ static char ** get_ssh ( unsigned int *length )
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *fd = NULL;
|
FILE *fd = NULL;
|
||||||
const char *hd = getenv ( "HOME" );
|
const char *hd = g_get_home_dir ();
|
||||||
path = g_build_filename ( hd, ".ssh", "config", NULL );
|
path = g_build_filename ( hd, ".ssh", "config", NULL );
|
||||||
fd = fopen ( path, "r" );
|
fd = fopen ( path, "r" );
|
||||||
|
|
||||||
|
|
|
@ -830,15 +830,16 @@ int main ( int argc, char *argv[] )
|
||||||
atexit ( cleanup );
|
atexit ( cleanup );
|
||||||
|
|
||||||
TICK ();
|
TICK ();
|
||||||
// Get DISPLAY, first env, then argument.
|
|
||||||
char *display_str = getenv ( "DISPLAY" );
|
|
||||||
find_arg_str ( "-display", &display_str );
|
|
||||||
|
|
||||||
if ( setlocale ( LC_ALL, "" ) == NULL ) {
|
if ( setlocale ( LC_ALL, "" ) == NULL ) {
|
||||||
fprintf ( stderr, "Failed to set locale.\n" );
|
fprintf ( stderr, "Failed to set locale.\n" );
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get DISPLAY, first env, then argument.
|
||||||
|
// We never modify display_str content.
|
||||||
|
char *display_str = ( char *)g_getenv ( "DISPLAY" );
|
||||||
|
find_arg_str ( "-display", &display_str );
|
||||||
|
|
||||||
xcb->connection = xcb_connect ( display_str, &xcb->screen_nbr );
|
xcb->connection = xcb_connect ( display_str, &xcb->screen_nbr );
|
||||||
if ( xcb_connection_has_error ( xcb->connection ) ) {
|
if ( xcb_connection_has_error ( xcb->connection ) ) {
|
||||||
fprintf ( stderr, "Failed to open display: %s", display_str );
|
fprintf ( stderr, "Failed to open display: %s", display_str );
|
||||||
|
|
Loading…
Reference in a new issue