authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-11 16:23:49-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-12 00:14:08-07:00
log768cb7e406fe26711167cbb2d67efdc10f830fdc
tree9ccf722cfd6fc72b5bd0e923040d543f55d33b91
parentdad07fb6f33d9024dc6528ca3de37715fbc13182

objcopy: use the fatal helper method


1 files changed, 2 insertions(+), 8 deletions(-)

lib/compiler/objcopy.zig+2-8
...@@ -198,20 +198,14 @@ fn cmdObjCopy(...@@ -198,20 +198,14 @@ fn cmdObjCopy(
198 return std.process.cleanExit();198 return std.process.cleanExit();
199 },199 },
200 .update => {200 .update => {
201 if (seen_update) {201 if (seen_update) fatal("zig objcopy only supports 1 update for now", .{});
202 std.debug.print("zig objcopy only supports 1 update for now\n", .{});
203 std.process.exit(1);
204 }
205 seen_update = true;202 seen_update = true;
206203
207 try server.serveEmitBinPath(output, .{204 try server.serveEmitBinPath(output, .{
208 .flags = .{ .cache_hit = false },205 .flags = .{ .cache_hit = false },
209 });206 });
210 },207 },
211 else => {208 else => fatal("unsupported message: {s}", .{@tagName(hdr.tag)}),
212 std.debug.print("unsupported message: {s}", .{@tagName(hdr.tag)});
213 std.process.exit(1);
214 },
215 }209 }
216 }210 }
217 }211 }