Re: desktop.links entries - was Re: Advocacy report [part 2]
- From: Paul G Cooper <pgc maths warwick ac uk>
- To: James Henstridge <james daa com au>
- cc: Gnome List <gnome-list gnome org>
- Subject: Re: desktop.links entries - was Re: Advocacy report [part 2]
- Date: Mon, 1 Nov 1999 15:00:39 +0000 (GMT)
On Mon, 1 Nov 1999, James Henstridge wrote:
> Try changing the include line near the top of the program to:
>
> #include <libgnome/libgnome.h>
>
> That should fix your problem.
Thanks, that helped but still had a problem, looked in developer.gnome.org
and found *I think* I have to add "Icon" to the gnome_metadata_set call,
so the prog now looks like,
------------------------------------
#include <libgnome/libgnome.h>
void set_icon (char *filename, char *icon_path)
{
gnome_metadata_set (filename, "Icon", strlen (icon_path) + 1,
icon_path);
}
int main (int argc, char *argv)
{
if (argc != 3){
fprintf (stderr, "Usage: set-icon filename icon-filename");
exit (1);
}
set_icon (argv [1], argv [2]);
}
-----------------------------------------
So now it compiles however when I try it, it segfaults - gdb gives
(gdb) run $HOME/.gnome-desktop/floppy /usr/share/pixmaps/mc/i-floppy.png
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /maths/students/pgc/compsys/progs/set-icon
$HOME/.gnome-desktop/floppy /usr/share/pixmaps/mc/i-floppy.png
Program received signal SIGSEGV, Segmentation fault.
0x400fa027 in strlen (str=0xffffffff <Address 0xffffffff out of bounds>)
at ../sysdeps/i386/strlen.c:27
../sysdeps/i386/strlen.c:27: No such file or directory.
Strace in attached file,
Paul
execve("./set-icon", ["set-icon", "/maths/students/pgc/.gnome-desktop/floppy", "/usr/share/pixmaps/mc/i-floppy.png"], [/* 61 vars */]) = 0
brk(0) = 0x8049954
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat(4, {st_mode=0, st_size=0, ...}) = 0
mmap(0, 18532, PROT_READ, MAP_PRIVATE, 4, 0) = 0x40014000
close(4) = 0
open("/usr/lib/libgnome.so.32", O_RDONLY) = 4
fstat(4, {st_mode=0, st_size=0, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 89188, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x40019000
mprotect(0x4002e000, 3172, PROT_NONE) = 0
mmap(0x4002e000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x14000) = 0x4002e000
close(4) = 0
open("/usr/lib/libgnomesupport.so.0", O_RDONLY) = 4
fstat(4, {st_mode=0, st_size=0, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 20320, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4002f000
mprotect(0x40033000, 3936, PROT_NONE) = 0
mmap(0x40033000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x3000) = 0x40033000
close(4) = 0
open("/usr/lib/libesd.so.0", O_RDONLY) = 4
fstat(4, {st_mode=0, st_size=0, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 26344, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x40034000
mprotect(0x4003a000, 1768, PROT_NONE) = 0
mmap(0x4003a000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x5000) = 0x4003a000
close(4) = 0
open("/usr/lib/libaudiofile.so.0", O_RDONLY) = 4
fstat(4, {st_mode=0, st_size=0, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4003b000
mmap(0, 72228, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4003c000
mprotect(0x4004c000, 6692, PROT_NONE) = 0
mmap(0x4004c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0xf000) = 0x4004c000
close(4) = 0
open("/lib/libm.so.6", O_RDONLY) = 4
fstat(4, {st_mode=0, st_size=0, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 114680, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4004e000
mprotect(0x40069000, 4088, PROT_NONE) = 0
mmap(0x40069000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x1a000) = 0x40069000
close(4) = 0
open("/lib/libdb.so.2", O_RDONLY) = 4
fstat(4, {st_mode=0, st_size=0, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 53532, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4006a000
mprotect(0x40076000, 4380, PROT_NONE) = 0
mmap(0x40076000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0xb000) = 0x40076000
close(4) = 0
open("/usr/lib/libglib-1.2.so.0", O_RDONLY) = 4
fstat(4, {st_mode=0, st_size=0, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 138356, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x40078000
mprotect(0x40099000, 3188, PROT_NONE) = 0
mmap(0x40099000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x20000) = 0x40099000
close(4) = 0
open("/lib/libdl.so.2", O_RDONLY) = 4
fstat(4, {st_mode=0, st_size=0, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 11532, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4009a000
mprotect(0x4009c000, 3340, PROT_NONE) = 0
mmap(0x4009c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x1000) = 0x4009c000
close(4) = 0
open("/lib/libc.so.6", O_RDONLY) = 4
fstat(4, {st_mode=0, st_size=0, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 974392, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4009d000
mprotect(0x40183000, 32312, PROT_NONE) = 0
mmap(0x40183000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0xe5000) = 0x40183000
mmap(0x40188000, 11832, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40188000
close(4) = 0
open("/usr/lib/libz.so.1", O_RDONLY) = 4
fstat(4, {st_mode=0, st_size=0, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 58092, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4018b000
mprotect(0x40197000, 8940, PROT_NONE) = 0
mmap(0x40197000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0xb000) = 0x40197000
close(4) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4019a000
munmap(0x40014000, 18532) = 0
personality(PER_LINUX) = 0
getpid() = 29074
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]