mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
Die immediately if the output file is a directory.
Thu Nov 9 16:01:47 2006 Søren Sandmann <sandmann@redhat.com> * sysprof-text.c (main): Die immediately if the output file is a directory. * autogen.sh (DIE): Also work when automake-1.9 is installed.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
0513ed87e8
commit
442a9b4f3c
@ -1,3 +1,10 @@
|
|||||||
|
Thu Nov 9 16:01:47 2006 Søren Sandmann <sandmann@redhat.com>
|
||||||
|
|
||||||
|
* sysprof-text.c (main): Die immediately if the output file is a
|
||||||
|
directory.
|
||||||
|
|
||||||
|
* autogen.sh (DIE): Also work when automake-1.9 is installed.
|
||||||
|
|
||||||
2006-11-02 Soren Sandmann <sandmann@daimi.au.dk>
|
2006-11-02 Soren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
Valgrind:
|
Valgrind:
|
||||||
|
|||||||
12
autogen.sh
12
autogen.sh
@ -24,11 +24,13 @@ if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then
|
|||||||
AUTOMAKE=automake-1.7
|
AUTOMAKE=automake-1.7
|
||||||
ACLOCAL=aclocal-1.7
|
ACLOCAL=aclocal-1.7
|
||||||
else
|
else
|
||||||
echo
|
if automake-1.9 --version < /dev/null > /dev/null 2>&1 ; then
|
||||||
echo "You must have automake 1.7.x installed to compile $PROJECT."
|
AUTOMAKE=automake-1.9
|
||||||
echo "Install the appropriate package for your distribution,"
|
ACLOCAL=aclocal-1.9
|
||||||
echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
|
else
|
||||||
DIE=1
|
AUTOMAKE=automake
|
||||||
|
ACLOCAL=aclocal
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$DIE" -eq 1; then
|
if test "$DIE" -eq 1; then
|
||||||
|
|||||||
@ -231,6 +231,8 @@ bin_file_new (const char *filename)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
bf->elf = elf_parser_new (filename, NULL);
|
bf->elf = elf_parser_new (filename, NULL);
|
||||||
|
if (!bf->elf)
|
||||||
|
g_print ("Could not parse file %s\n", bf->elf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We need the text offset of the actual binary, not the
|
/* We need the text offset of the actual binary, not the
|
||||||
|
|||||||
@ -86,6 +86,14 @@ usage_msg (const char *name)
|
|||||||
name);
|
name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
file_exists_and_is_dir (const char *name)
|
||||||
|
{
|
||||||
|
return
|
||||||
|
g_file_test (name, G_FILE_TEST_EXISTS) &&
|
||||||
|
g_file_test (name, G_FILE_TEST_IS_DIR);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
die (const char *err_msg)
|
die (const char *err_msg)
|
||||||
{
|
{
|
||||||
@ -119,6 +127,13 @@ main (int argc,
|
|||||||
|
|
||||||
if (!signal_set_handler (SIGINT, signal_handler, app, &err))
|
if (!signal_set_handler (SIGINT, signal_handler, app, &err))
|
||||||
die (err->message);
|
die (err->message);
|
||||||
|
|
||||||
|
if (file_exists_and_is_dir (app->outfile))
|
||||||
|
{
|
||||||
|
char *msg = g_strdup_printf ("Can't write to %s: is a directory\n",
|
||||||
|
app->outfile);
|
||||||
|
die (msg);
|
||||||
|
}
|
||||||
|
|
||||||
g_main_loop_run (app->main_loop);
|
g_main_loop_run (app->main_loop);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user