changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > plan9front / sys/src/cmd/gs/src/zdevice2.c

revision 7253: 986e26228cfe
parent 0: eaccc3e8d226
     1.1--- a/sys/src/cmd/gs/src/zdevice2.c
     1.2+++ b/sys/src/cmd/gs/src/zdevice2.c
     1.3@@ -27,6 +27,7 @@
     1.4 #include "igstate.h"
     1.5 #include "iname.h"
     1.6 #include "iutil.h"
     1.7+#include "isave.h"
     1.8 #include "store.h"
     1.9 #include "gxdevice.h"
    1.10 #include "gsstate.h"
    1.11@@ -312,6 +313,12 @@ z2grestoreall(i_ctx_t *i_ctx_p)
    1.12 private int
    1.13 z2restore(i_ctx_t *i_ctx_p)
    1.14 {
    1.15+    alloc_save_t *asave;
    1.16+    bool saveLockSafety = gs_currentdevice_inline(igs)->LockSafetyParams;
    1.17+    int code = restore_check_save(i_ctx_p, &asave);
    1.18+
    1.19+    if (code < 0) return code;
    1.20+
    1.21     while (gs_state_saved(gs_state_saved(igs))) {
    1.22 	if (restore_page_device(igs, gs_state_saved(igs)))
    1.23 	    return push_callout(i_ctx_p, "%restore1pagedevice");
    1.24@@ -319,7 +326,10 @@ z2restore(i_ctx_t *i_ctx_p)
    1.25     }
    1.26     if (restore_page_device(igs, gs_state_saved(igs)))
    1.27 	return push_callout(i_ctx_p, "%restorepagedevice");
    1.28-    return zrestore(i_ctx_p);
    1.29+    code = dorestore(i_ctx_p, asave);
    1.30+    if (code < 0)
    1.31+        gs_currentdevice_inline(igs)->LockSafetyParams = saveLockSafety;
    1.32+    return code;
    1.33 }
    1.34 
    1.35 /* <gstate> setgstate - */