applied gimp-entity-980929-1, adds write error handling
* app/temp_buf.c: applied gimp-entity-980929-1, adds write error handling * app/gimprc.c * app/install.c * app/tips_dialog.c: allow use of GIMP_DATADIR to override compiled in default * HACKING * autogen.sh: we need libtool 1.2b now -Yosh
This commit is contained in:
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
|||||||
|
Sat Oct 10 00:48:30 PDT 1998 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
|
* app/temp_buf.c: applied gimp-entity-980929-1, adds
|
||||||
|
write error handling
|
||||||
|
|
||||||
|
* app/gimprc.c
|
||||||
|
* app/install.c
|
||||||
|
* app/tips_dialog.c: allow use of GIMP_DATADIR to override
|
||||||
|
compiled in default
|
||||||
|
|
||||||
|
* HACKING
|
||||||
|
* autogen.sh: we need libtool 1.2b now
|
||||||
|
|
||||||
Fri Oct 9 18:52:52 BST 1998 Adam D. Moss <adam@gimp.org>
|
Fri Oct 9 18:52:52 BST 1998 Adam D. Moss <adam@gimp.org>
|
||||||
|
|
||||||
* plug-ins/gif/gif.c: Added support for persistant GIF
|
* plug-ins/gif/gif.c: Added support for persistant GIF
|
||||||
|
2
HACKING
2
HACKING
@ -3,7 +3,7 @@ to have the following packages installed:
|
|||||||
|
|
||||||
- GNU autoconf 2.12
|
- GNU autoconf 2.12
|
||||||
- GNU automake 1.3
|
- GNU automake 1.3
|
||||||
- GNU libtool 1.2
|
- GNU libtool 1.2b
|
||||||
|
|
||||||
These should be available by ftp from prep.ai.mit.edu or any of the
|
These should be available by ftp from prep.ai.mit.edu or any of the
|
||||||
fine GNU mirrors. Beta software can be found at alpha.gnu.org.
|
fine GNU mirrors. Beta software can be found at alpha.gnu.org.
|
||||||
|
@ -474,11 +474,21 @@ temp_buf_swap (buf)
|
|||||||
/* Open file for overwrite */
|
/* Open file for overwrite */
|
||||||
if ((fp = fopen (filename, "wb")))
|
if ((fp = fopen (filename, "wb")))
|
||||||
{
|
{
|
||||||
fwrite (swap->data, swap->width * swap->height * swap->bytes, 1, fp);
|
size_t blocks_written;
|
||||||
fclose (fp);
|
blocks_written = fwrite (swap->data, swap->width * swap->height * swap->bytes, 1, fp);
|
||||||
|
/* Check whether all bytes were written and fclose() was able to flush its buffers */
|
||||||
|
if ((0 != fclose (fp)) || (1 != blocks_written))
|
||||||
|
{
|
||||||
|
(void) unlink (filename);
|
||||||
|
perror ("Write error on temp buf");
|
||||||
|
g_message ("Cannot write \"%s\"", filename);
|
||||||
|
g_free (filename);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
(void) unlink (filename);
|
||||||
perror ("Error in temp buf caching");
|
perror ("Error in temp buf caching");
|
||||||
g_message ("Cannot write \"%s\"", filename);
|
g_message ("Cannot write \"%s\"", filename);
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
@ -522,11 +532,11 @@ temp_buf_unswap (buf)
|
|||||||
{
|
{
|
||||||
if ((fp = fopen (buf->filename, "rb")))
|
if ((fp = fopen (buf->filename, "rb")))
|
||||||
{
|
{
|
||||||
size_t blocksRead;
|
size_t blocks_read;
|
||||||
blocksRead = fread (buf->data, buf->width * buf->height * buf->bytes, 1, fp);
|
blocks_read = fread (buf->data, buf->width * buf->height * buf->bytes, 1, fp);
|
||||||
fclose (fp);
|
(void) fclose (fp);
|
||||||
if (blocksRead != 1)
|
if (blocks_read != 1)
|
||||||
perror ("Read error on temp buf");
|
perror ("Read error on temp buf");
|
||||||
else
|
else
|
||||||
succ = TRUE;
|
succ = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -35,13 +35,17 @@ tips_dialog_create ()
|
|||||||
guchar * temp;
|
guchar * temp;
|
||||||
guchar * src;
|
guchar * src;
|
||||||
guchar * dest;
|
guchar * dest;
|
||||||
|
gchar * gimp_data_dir;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
if (tips_count == 0)
|
if (tips_count == 0)
|
||||||
{
|
{
|
||||||
temp = g_malloc (512);
|
temp = g_malloc (512);
|
||||||
sprintf ((char *)temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
|
if ((gimp_data_dir = getenv ("GIMP_DATADIR")) != NULL)
|
||||||
|
sprintf ((char *)temp, "%s/%s", gimp_data_dir, TIPS_FILE_NAME);
|
||||||
|
else
|
||||||
|
sprintf ((char *)temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
|
||||||
read_tips_file ((char *)temp);
|
read_tips_file ((char *)temp);
|
||||||
g_free (temp);
|
g_free (temp);
|
||||||
}
|
}
|
||||||
|
@ -372,6 +372,7 @@ install_run (InstallCallback callback)
|
|||||||
GdkFont *font;
|
GdkFont *font;
|
||||||
FILE *pfp;
|
FILE *pfp;
|
||||||
char buffer[2048];
|
char buffer[2048];
|
||||||
|
char *gimp_data_dir;
|
||||||
struct stat stat_buf;
|
struct stat stat_buf;
|
||||||
int err;
|
int err;
|
||||||
int executable = TRUE;
|
int executable = TRUE;
|
||||||
@ -415,7 +416,11 @@ install_run (InstallCallback callback)
|
|||||||
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, "User Installation Log\n\n", -1);
|
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, "User Installation Log\n\n", -1);
|
||||||
|
|
||||||
/* Generate output */
|
/* Generate output */
|
||||||
sprintf (buffer, "%s/user_install", DATADIR);
|
if ((gimp_data_dir = getenv ("GIMP_DATADIR")) != NULL)
|
||||||
|
sprintf (buffer, "%s/user_install", gimp_data_dir);
|
||||||
|
else
|
||||||
|
sprintf (buffer, "%s/user_install", DATADIR);
|
||||||
|
|
||||||
if ((err = stat (buffer, &stat_buf)) != 0)
|
if ((err = stat (buffer, &stat_buf)) != 0)
|
||||||
{
|
{
|
||||||
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, buffer, -1);
|
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, buffer, -1);
|
||||||
@ -433,8 +438,13 @@ install_run (InstallCallback callback)
|
|||||||
|
|
||||||
if (executable == TRUE)
|
if (executable == TRUE)
|
||||||
{
|
{
|
||||||
sprintf (buffer, "%s/user_install %s %s", DATADIR, DATADIR,
|
if (gimp_data_dir)
|
||||||
gimp_directory ());
|
sprintf (buffer, "%s/user_install %s %s", gimp_data_dir, gimp_data_dir,
|
||||||
|
gimp_directory ());
|
||||||
|
else
|
||||||
|
sprintf (buffer, "%s/user_install %s %s", DATADIR, DATADIR,
|
||||||
|
gimp_directory ());
|
||||||
|
|
||||||
if ((pfp = popen (buffer, "r")) != NULL)
|
if ((pfp = popen (buffer, "r")) != NULL)
|
||||||
{
|
{
|
||||||
while (fgets (buffer, 2048, pfp))
|
while (fgets (buffer, 2048, pfp))
|
||||||
|
@ -324,6 +324,7 @@ parse_gimprc ()
|
|||||||
{
|
{
|
||||||
char libfilename[512];
|
char libfilename[512];
|
||||||
char filename[512];
|
char filename[512];
|
||||||
|
char *gimp_data_dir;
|
||||||
char *gimp_dir;
|
char *gimp_dir;
|
||||||
|
|
||||||
parse_info.buffer = g_new (char, 4096);
|
parse_info.buffer = g_new (char, 4096);
|
||||||
@ -334,7 +335,11 @@ parse_gimprc ()
|
|||||||
gimp_dir = gimp_directory ();
|
gimp_dir = gimp_directory ();
|
||||||
add_gimp_directory_token (gimp_dir);
|
add_gimp_directory_token (gimp_dir);
|
||||||
|
|
||||||
sprintf (libfilename, "%s/gimprc", DATADIR);
|
if ((gimp_data_dir = getenv ("GIMP_DATADIR")) != NULL)
|
||||||
|
sprintf (libfilename, "%s/gimprc", gimp_data_dir);
|
||||||
|
else
|
||||||
|
sprintf (libfilename, "%s/gimprc", DATADIR);
|
||||||
|
|
||||||
app_init_update_status("Resource configuration", libfilename, -1);
|
app_init_update_status("Resource configuration", libfilename, -1);
|
||||||
if (alternate_system_gimprc != NULL)
|
if (alternate_system_gimprc != NULL)
|
||||||
{
|
{
|
||||||
|
@ -35,13 +35,17 @@ tips_dialog_create ()
|
|||||||
guchar * temp;
|
guchar * temp;
|
||||||
guchar * src;
|
guchar * src;
|
||||||
guchar * dest;
|
guchar * dest;
|
||||||
|
gchar * gimp_data_dir;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
if (tips_count == 0)
|
if (tips_count == 0)
|
||||||
{
|
{
|
||||||
temp = g_malloc (512);
|
temp = g_malloc (512);
|
||||||
sprintf ((char *)temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
|
if ((gimp_data_dir = getenv ("GIMP_DATADIR")) != NULL)
|
||||||
|
sprintf ((char *)temp, "%s/%s", gimp_data_dir, TIPS_FILE_NAME);
|
||||||
|
else
|
||||||
|
sprintf ((char *)temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
|
||||||
read_tips_file ((char *)temp);
|
read_tips_file ((char *)temp);
|
||||||
g_free (temp);
|
g_free (temp);
|
||||||
}
|
}
|
||||||
|
@ -372,6 +372,7 @@ install_run (InstallCallback callback)
|
|||||||
GdkFont *font;
|
GdkFont *font;
|
||||||
FILE *pfp;
|
FILE *pfp;
|
||||||
char buffer[2048];
|
char buffer[2048];
|
||||||
|
char *gimp_data_dir;
|
||||||
struct stat stat_buf;
|
struct stat stat_buf;
|
||||||
int err;
|
int err;
|
||||||
int executable = TRUE;
|
int executable = TRUE;
|
||||||
@ -415,7 +416,11 @@ install_run (InstallCallback callback)
|
|||||||
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, "User Installation Log\n\n", -1);
|
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, "User Installation Log\n\n", -1);
|
||||||
|
|
||||||
/* Generate output */
|
/* Generate output */
|
||||||
sprintf (buffer, "%s/user_install", DATADIR);
|
if ((gimp_data_dir = getenv ("GIMP_DATADIR")) != NULL)
|
||||||
|
sprintf (buffer, "%s/user_install", gimp_data_dir);
|
||||||
|
else
|
||||||
|
sprintf (buffer, "%s/user_install", DATADIR);
|
||||||
|
|
||||||
if ((err = stat (buffer, &stat_buf)) != 0)
|
if ((err = stat (buffer, &stat_buf)) != 0)
|
||||||
{
|
{
|
||||||
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, buffer, -1);
|
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, buffer, -1);
|
||||||
@ -433,8 +438,13 @@ install_run (InstallCallback callback)
|
|||||||
|
|
||||||
if (executable == TRUE)
|
if (executable == TRUE)
|
||||||
{
|
{
|
||||||
sprintf (buffer, "%s/user_install %s %s", DATADIR, DATADIR,
|
if (gimp_data_dir)
|
||||||
gimp_directory ());
|
sprintf (buffer, "%s/user_install %s %s", gimp_data_dir, gimp_data_dir,
|
||||||
|
gimp_directory ());
|
||||||
|
else
|
||||||
|
sprintf (buffer, "%s/user_install %s %s", DATADIR, DATADIR,
|
||||||
|
gimp_directory ());
|
||||||
|
|
||||||
if ((pfp = popen (buffer, "r")) != NULL)
|
if ((pfp = popen (buffer, "r")) != NULL)
|
||||||
{
|
{
|
||||||
while (fgets (buffer, 2048, pfp))
|
while (fgets (buffer, 2048, pfp))
|
||||||
|
@ -372,6 +372,7 @@ install_run (InstallCallback callback)
|
|||||||
GdkFont *font;
|
GdkFont *font;
|
||||||
FILE *pfp;
|
FILE *pfp;
|
||||||
char buffer[2048];
|
char buffer[2048];
|
||||||
|
char *gimp_data_dir;
|
||||||
struct stat stat_buf;
|
struct stat stat_buf;
|
||||||
int err;
|
int err;
|
||||||
int executable = TRUE;
|
int executable = TRUE;
|
||||||
@ -415,7 +416,11 @@ install_run (InstallCallback callback)
|
|||||||
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, "User Installation Log\n\n", -1);
|
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, "User Installation Log\n\n", -1);
|
||||||
|
|
||||||
/* Generate output */
|
/* Generate output */
|
||||||
sprintf (buffer, "%s/user_install", DATADIR);
|
if ((gimp_data_dir = getenv ("GIMP_DATADIR")) != NULL)
|
||||||
|
sprintf (buffer, "%s/user_install", gimp_data_dir);
|
||||||
|
else
|
||||||
|
sprintf (buffer, "%s/user_install", DATADIR);
|
||||||
|
|
||||||
if ((err = stat (buffer, &stat_buf)) != 0)
|
if ((err = stat (buffer, &stat_buf)) != 0)
|
||||||
{
|
{
|
||||||
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, buffer, -1);
|
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, buffer, -1);
|
||||||
@ -433,8 +438,13 @@ install_run (InstallCallback callback)
|
|||||||
|
|
||||||
if (executable == TRUE)
|
if (executable == TRUE)
|
||||||
{
|
{
|
||||||
sprintf (buffer, "%s/user_install %s %s", DATADIR, DATADIR,
|
if (gimp_data_dir)
|
||||||
gimp_directory ());
|
sprintf (buffer, "%s/user_install %s %s", gimp_data_dir, gimp_data_dir,
|
||||||
|
gimp_directory ());
|
||||||
|
else
|
||||||
|
sprintf (buffer, "%s/user_install %s %s", DATADIR, DATADIR,
|
||||||
|
gimp_directory ());
|
||||||
|
|
||||||
if ((pfp = popen (buffer, "r")) != NULL)
|
if ((pfp = popen (buffer, "r")) != NULL)
|
||||||
{
|
{
|
||||||
while (fgets (buffer, 2048, pfp))
|
while (fgets (buffer, 2048, pfp))
|
||||||
|
@ -474,11 +474,21 @@ temp_buf_swap (buf)
|
|||||||
/* Open file for overwrite */
|
/* Open file for overwrite */
|
||||||
if ((fp = fopen (filename, "wb")))
|
if ((fp = fopen (filename, "wb")))
|
||||||
{
|
{
|
||||||
fwrite (swap->data, swap->width * swap->height * swap->bytes, 1, fp);
|
size_t blocks_written;
|
||||||
fclose (fp);
|
blocks_written = fwrite (swap->data, swap->width * swap->height * swap->bytes, 1, fp);
|
||||||
|
/* Check whether all bytes were written and fclose() was able to flush its buffers */
|
||||||
|
if ((0 != fclose (fp)) || (1 != blocks_written))
|
||||||
|
{
|
||||||
|
(void) unlink (filename);
|
||||||
|
perror ("Write error on temp buf");
|
||||||
|
g_message ("Cannot write \"%s\"", filename);
|
||||||
|
g_free (filename);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
(void) unlink (filename);
|
||||||
perror ("Error in temp buf caching");
|
perror ("Error in temp buf caching");
|
||||||
g_message ("Cannot write \"%s\"", filename);
|
g_message ("Cannot write \"%s\"", filename);
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
@ -522,11 +532,11 @@ temp_buf_unswap (buf)
|
|||||||
{
|
{
|
||||||
if ((fp = fopen (buf->filename, "rb")))
|
if ((fp = fopen (buf->filename, "rb")))
|
||||||
{
|
{
|
||||||
size_t blocksRead;
|
size_t blocks_read;
|
||||||
blocksRead = fread (buf->data, buf->width * buf->height * buf->bytes, 1, fp);
|
blocks_read = fread (buf->data, buf->width * buf->height * buf->bytes, 1, fp);
|
||||||
fclose (fp);
|
(void) fclose (fp);
|
||||||
if (blocksRead != 1)
|
if (blocks_read != 1)
|
||||||
perror ("Read error on temp buf");
|
perror ("Read error on temp buf");
|
||||||
else
|
else
|
||||||
succ = TRUE;
|
succ = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -35,13 +35,17 @@ tips_dialog_create ()
|
|||||||
guchar * temp;
|
guchar * temp;
|
||||||
guchar * src;
|
guchar * src;
|
||||||
guchar * dest;
|
guchar * dest;
|
||||||
|
gchar * gimp_data_dir;
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
if (tips_count == 0)
|
if (tips_count == 0)
|
||||||
{
|
{
|
||||||
temp = g_malloc (512);
|
temp = g_malloc (512);
|
||||||
sprintf ((char *)temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
|
if ((gimp_data_dir = getenv ("GIMP_DATADIR")) != NULL)
|
||||||
|
sprintf ((char *)temp, "%s/%s", gimp_data_dir, TIPS_FILE_NAME);
|
||||||
|
else
|
||||||
|
sprintf ((char *)temp, "%s/%s", DATADIR, TIPS_FILE_NAME);
|
||||||
read_tips_file ((char *)temp);
|
read_tips_file ((char *)temp);
|
||||||
g_free (temp);
|
g_free (temp);
|
||||||
}
|
}
|
||||||
|
@ -372,6 +372,7 @@ install_run (InstallCallback callback)
|
|||||||
GdkFont *font;
|
GdkFont *font;
|
||||||
FILE *pfp;
|
FILE *pfp;
|
||||||
char buffer[2048];
|
char buffer[2048];
|
||||||
|
char *gimp_data_dir;
|
||||||
struct stat stat_buf;
|
struct stat stat_buf;
|
||||||
int err;
|
int err;
|
||||||
int executable = TRUE;
|
int executable = TRUE;
|
||||||
@ -415,7 +416,11 @@ install_run (InstallCallback callback)
|
|||||||
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, "User Installation Log\n\n", -1);
|
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, "User Installation Log\n\n", -1);
|
||||||
|
|
||||||
/* Generate output */
|
/* Generate output */
|
||||||
sprintf (buffer, "%s/user_install", DATADIR);
|
if ((gimp_data_dir = getenv ("GIMP_DATADIR")) != NULL)
|
||||||
|
sprintf (buffer, "%s/user_install", gimp_data_dir);
|
||||||
|
else
|
||||||
|
sprintf (buffer, "%s/user_install", DATADIR);
|
||||||
|
|
||||||
if ((err = stat (buffer, &stat_buf)) != 0)
|
if ((err = stat (buffer, &stat_buf)) != 0)
|
||||||
{
|
{
|
||||||
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, buffer, -1);
|
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, buffer, -1);
|
||||||
@ -433,8 +438,13 @@ install_run (InstallCallback callback)
|
|||||||
|
|
||||||
if (executable == TRUE)
|
if (executable == TRUE)
|
||||||
{
|
{
|
||||||
sprintf (buffer, "%s/user_install %s %s", DATADIR, DATADIR,
|
if (gimp_data_dir)
|
||||||
gimp_directory ());
|
sprintf (buffer, "%s/user_install %s %s", gimp_data_dir, gimp_data_dir,
|
||||||
|
gimp_directory ());
|
||||||
|
else
|
||||||
|
sprintf (buffer, "%s/user_install %s %s", DATADIR, DATADIR,
|
||||||
|
gimp_directory ());
|
||||||
|
|
||||||
if ((pfp = popen (buffer, "r")) != NULL)
|
if ((pfp = popen (buffer, "r")) != NULL)
|
||||||
{
|
{
|
||||||
while (fgets (buffer, 2048, pfp))
|
while (fgets (buffer, 2048, pfp))
|
||||||
|
@ -14,7 +14,7 @@ DIE=0
|
|||||||
(libtool --version) < /dev/null > /dev/null 2>&1 || {
|
(libtool --version) < /dev/null > /dev/null 2>&1 || {
|
||||||
echo
|
echo
|
||||||
echo "You must have libtool installed to compile GIMP."
|
echo "You must have libtool installed to compile GIMP."
|
||||||
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2.tar.gz"
|
echo "Get ftp://alpha.gnu.org/pub/gnu/libtool-1.2b.tar.gz"
|
||||||
echo "(or a newer version if it is available)"
|
echo "(or a newer version if it is available)"
|
||||||
DIE=1
|
DIE=1
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user