Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6a4fa7e

Browse files
committed
On HPUX, shl_load should be called with options BIND_IMMEDIATE rather
than BIND_DEFERRED. That way, if the loaded library has unresolvedreferences, shl_load fails cleanly. As we had it, shl_load wouldsucceed and then the dynlinker would call abort() when we try to callinto the loaded library. abort()ing a backend is uncool.
1 parent00645eb commit6a4fa7e

File tree

1 file changed

+11
-2
lines changed
  • src/backend/port/dynloader

1 file changed

+11
-2
lines changed

‎src/backend/port/dynloader/hpux.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/hpux.c,v 1.12 2000/01/2605:56:44 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/hpux.c,v 1.13 2000/04/2623:35:34 tgl Exp $
1212
*
1313
*NOTES
1414
*all functions are defined here -- it's impossible to trace the
@@ -20,6 +20,7 @@
2020
#include<a.out.h>
2121

2222
#include"postgres.h"
23+
2324
#include"dl.h"
2425
#include"dynloader.h"
2526
#include"fmgr.h"
@@ -28,7 +29,12 @@
2829
void*
2930
pg_dlopen(char*filename)
3031
{
31-
shl_thandle=shl_load(filename,BIND_DEFERRED,0);
32+
/*
33+
* Use BIND_IMMEDIATE so that undefined symbols cause a failure return
34+
* from shl_load(), rather than an abort() later on when we attempt to
35+
* call the library!
36+
*/
37+
shl_thandle=shl_load(filename,BIND_IMMEDIATE |BIND_VERBOSE,0);
3238

3339
return (void*)handle;
3440
}
@@ -54,5 +60,8 @@ pg_dlerror()
5460
{
5561
staticcharerrmsg[]="shl_load failed";
5662

63+
if (errno)
64+
returnstrerror(errno);
65+
5766
returnerrmsg;
5867
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp