diff options
author | jilles <jilles@FreeBSD.org> | 2009-06-23 20:45:12 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2009-06-23 20:45:12 +0000 |
commit | 39fa9f1c9918ad9bb25af4f1bbce28c34cb2cd65 (patch) | |
tree | d592f11be2381156c3c2f8e6dd6f4bcfb70c2c6c /bin/sh/var.c | |
parent | ecb123b94294aeb93d0b2ae271c070be043d1ba4 (diff) | |
download | FreeBSD-src-39fa9f1c9918ad9bb25af4f1bbce28c34cb2cd65.zip FreeBSD-src-39fa9f1c9918ad9bb25af4f1bbce28c34cb2cd65.tar.gz |
sh: Improve handling of setjmp/longjmp volatile:
- remove ineffective and unnecessary (void) &var; [1]
- remove some unnecessary volatile keywords
- add a necessary volatile keyword
- save the old handler before doing something that could use the saved
value
Submitted by: Christoph Mallon [1]
Approved by: ed (mentor)
Diffstat (limited to 'bin/sh/var.c')
-rw-r--r-- | bin/sh/var.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/bin/sh/var.c b/bin/sh/var.c index a12a568..2c1caf1 100644 --- a/bin/sh/var.c +++ b/bin/sh/var.c @@ -193,12 +193,8 @@ int setvarsafe(char *name, char *val, int flags) { struct jmploc jmploc; - struct jmploc *volatile savehandler = handler; + struct jmploc *const savehandler = handler; int err = 0; -#ifdef __GNUC__ - /* Avoid longjmp clobbering */ - (void) &err; -#endif if (setjmp(jmploc.loc)) err = 1; |