From 43e84b26effe8cc6561b160601ebeaaab0f9cb51 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 23 Mar 1999 21:00:05 +0000 Subject: [PATCH] Ha! Nasty intermittent bug nailed (I think)! "That word, resLocked: I do not think it means what you think it means." HLock seems to be my friend though. [originally from svn r127] --- maccfg.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/maccfg.c b/maccfg.c index 5b11cae4..860a61d3 100644 --- a/maccfg.c +++ b/maccfg.c @@ -1,11 +1,13 @@ -/* $Id: maccfg.c,v 1.1.2.3 1999/03/16 20:27:30 ben Exp $ */ +/* $Id: maccfg.c,v 1.1.2.4 1999/03/23 21:00:05 ben Exp $ */ /* * maccfg.c -- Mac port configuration */ +#include #include #include +#include #include #include "putty.h" @@ -86,10 +88,10 @@ void mac_loadconfig(Config *cfg) { h = GetResource('pSET', PREF_settings); if (h == NULL || *h == NULL) fatalbox("Can't load settings"); - if (GetResourceSizeOnDisk(h) != sizeof(struct pSET)) + HLock(h); + if (GetHandleSize(h) != sizeof(struct pSET)) fatalbox("Settings resource is wrong size (%d vs %d)", - GetResourceSizeOnDisk(h), sizeof(struct pSET)); - SetResAttrs(h, GetResAttrs(h) | resLocked); + GetHandleSize(h), sizeof(struct pSET)); s = (struct pSET *)*h; /* Basic */ get_string(&s->host, cfg->host, sizeof(cfg->host)); @@ -131,7 +133,7 @@ void mac_loadconfig(Config *cfg) { /* Selection */ cfg->implicit_copy = (s->selection_flags & IMPLICIT_COPY) != 0; get_wordness(s->wordness_id, cfg->wordness); - SetResAttrs(h, GetResAttrs(h) & ~resLocked); + HUnlock(h); ReleaseResource(h); }