I tried a sample gdbm prog in trying to discover why perl (5.18) won't pass it's test suite (since 5.16, or last year) in regards to gdbm. The perl people kindly gave me a gdbm 'C' test to test if gdbm works from 'C'. I had gdbm-devel and libgdbm4 V 1.10-6.1 and upgraded to the latest in factory today (V1.10-6.5). The C program I used:
more test_gdbm.c #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <gdbm.h> #include <errno.h>
int main (int argc, char **argv) { GDBM_FILE dbf; datum key = { "somekey", 8 }; datum value = { "somevalue", 8 }; int ret; datum content; errno = 0; printf("gdbm_version = %s\n", gdbm_version); dbf = gdbm_open ("trial.gdbm", 0, GDBM_NEWDB, 0644, 0); if (!dbf) { printf("%s, errno = %d, gdbm_errno = %d\n", "Fatal error opening trial.gdbm", errno, gdbm_errno); exit(1); } ret = gdbm_store (dbf, key, value, GDBM_INSERT); if (ret != -1) { printf("Successfully stored key.\n"); } else { printf("%s ret = %d, errno = %d, gdbm_errno = %d\n", "Failed to store key.", ret, errno, gdbm_errno); } content = gdbm_fetch(dbf, key); if (content.dptr && strncmp(content.dptr, value.dptr, 7) == 0) { printf("Successfully fetched key.\n"); } else { printf("%s errno = %d, gdbm_errno = %d\n", "Failed to retrieve key.", errno, gdbm_errno); } gdbm_close(dbf); unlink("trial.gdbm"); printf ("done.\n"); return 0; } --- Building & running the above:
gcc -lgdbm -lgdbm_compat test_gdbm.c -o tg tg gdbm_version = GDBM version 1.10. 13/11/2011 Fatal error opening trial.gdbm, errno = 0, gdbm_errno = 2
Can someone verify this? If it is broken, that would be bad, since perl uses the above in its test suite -- and on my system, I've been getting breakages in building (and testing) perl for over a year... Thing is, I can't see how perl would have built and tested in factory with the above not working. So, what am I missing? -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org