diff options
author | Robert Haas <rhaas@postgresql.org> | 2013-07-22 15:41:44 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2013-07-22 15:41:44 -0400 |
commit | 026bc46da33ab6a6f720b0d0500e8a95d075ab92 (patch) | |
tree | d3c618d874a2e7f2ca919f5e5232983b0cfb5d46 /src | |
parent | 295f9bbf1d2d1e985471bd523c7c9bfd3d134759 (diff) | |
download | postgresql-026bc46da33ab6a6f720b0d0500e8a95d075ab92.tar.gz postgresql-026bc46da33ab6a6f720b0d0500e8a95d075ab92.zip |
Back-patch bgworker API changes to 9.3.
Commit 7f7485a0cde92aa4ba235a1ffe4dda0ca0b6cc9a made these changes
in master; per discussion, backport the API changes (but not the
functional changes), so that people don't get used to the 9.3 API
only to see it get broken in the next release. There are already
some people coding to the original 9.3 API, and this will cause
minor breakage, but there will be even more if we wait until next
year to roll out these changes.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 3 | ||||
-rw-r--r-- | src/include/postmaster/bgworker.h | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 1e41a0e75ec..f219bd13013 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -5247,9 +5247,6 @@ RegisterBackgroundWorker(BackgroundWorker *worker) } rw->rw_worker = *worker; - rw->rw_worker.bgw_name = ((char *) rw) + sizeof(RegisteredBgWorker); - strlcpy(rw->rw_worker.bgw_name, worker->bgw_name, namelen + 1); - rw->rw_backend = NULL; rw->rw_pid = 0; rw->rw_child_slot = 0; diff --git a/src/include/postmaster/bgworker.h b/src/include/postmaster/bgworker.h index e91e344eb67..e0f468fab9e 100644 --- a/src/include/postmaster/bgworker.h +++ b/src/include/postmaster/bgworker.h @@ -52,7 +52,7 @@ #define BGWORKER_BACKEND_DATABASE_CONNECTION 0x0002 -typedef void (*bgworker_main_type) (void *main_arg); +typedef void (*bgworker_main_type) (Datum main_arg); /* * Points in time at which a bgworker can request to be started @@ -66,15 +66,16 @@ typedef enum #define BGW_DEFAULT_RESTART_INTERVAL 60 #define BGW_NEVER_RESTART -1 +#define BGW_MAXLEN 64 typedef struct BackgroundWorker { - char *bgw_name; + char bgw_name[BGW_MAXLEN]; int bgw_flags; BgWorkerStartTime bgw_start_time; int bgw_restart_time; /* in seconds, or BGW_NEVER_RESTART */ bgworker_main_type bgw_main; - void *bgw_main_arg; + Datum bgw_main_arg; } BackgroundWorker; /* Register a new bgworker */ |