summaryrefslogtreecommitdiffstats
path: root/src/core/resolv.c
diff options
context:
space:
mode:
authorMichael Brown2011-06-24 15:14:41 +0200
committerMichael Brown2011-06-28 15:45:08 +0200
commite01ec74601b58f54a5e2ae7b9fd1196972034114 (patch)
tree54f2d2202274523e2365584502dee7db8deca43b /src/core/resolv.c
parent[xfer] Send xfer_window_changed() after xfer_vredirect() (diff)
downloadipxe-e01ec74601b58f54a5e2ae7b9fd1196972034114.tar.gz
ipxe-e01ec74601b58f54a5e2ae7b9fd1196972034114.tar.xz
ipxe-e01ec74601b58f54a5e2ae7b9fd1196972034114.zip
[process] Pass containing object pointer to process step() methods
Give the step() method a pointer to the containing object, rather than a pointer to the process. This is consistent with the operation of interface methods, and allows a single function to serve as both an interface method and a process step() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/resolv.c')
-rw-r--r--src/core/resolv.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/resolv.c b/src/core/resolv.c
index 91f0c15c..9edfcead 100644
--- a/src/core/resolv.c
+++ b/src/core/resolv.c
@@ -86,16 +86,17 @@ struct numeric_resolv {
int rc;
};
-static void numeric_step ( struct process *process ) {
- struct numeric_resolv *numeric =
- container_of ( process, struct numeric_resolv, process );
+static void numeric_step ( struct numeric_resolv *numeric ) {
- process_del ( process );
+ process_del ( &numeric->process );
if ( numeric->rc == 0 )
resolv_done ( &numeric->resolv, &numeric->sa );
intf_shutdown ( &numeric->resolv, numeric->rc );
}
+static struct process_descriptor numeric_process_desc =
+ PROC_DESC ( struct numeric_resolv, process, numeric_step );
+
static int numeric_resolv ( struct interface *resolv,
const char *name, struct sockaddr *sa ) {
struct numeric_resolv *numeric;
@@ -107,7 +108,8 @@ static int numeric_resolv ( struct interface *resolv,
return -ENOMEM;
ref_init ( &numeric->refcnt, NULL );
intf_init ( &numeric->resolv, &null_intf_desc, &numeric->refcnt );
- process_init ( &numeric->process, numeric_step, &numeric->refcnt );
+ process_init ( &numeric->process, &numeric_process_desc,
+ &numeric->refcnt );
memcpy ( &numeric->sa, sa, sizeof ( numeric->sa ) );
DBGC ( numeric, "NUMERIC %p attempting to resolve \"%s\"\n",