View | Details | Raw Unified | Return to bug 127220
Collapse All | Expand All

(-)err.3 (-4 / +4 lines)
Lines 178-192 Link Here
178
Display the current errno information string and exit:
178
Display the current errno information string and exit:
179
.Bd -literal -offset indent
179
.Bd -literal -offset indent
180
if ((p = malloc(size)) == NULL)
180
if ((p = malloc(size)) == NULL)
181
	err(1, NULL);
181
	err(EX_OSERR, NULL);
182
if ((fd = open(file_name, O_RDONLY, 0)) == -1)
182
if ((fd = open(file_name, O_RDONLY, 0)) == -1)
183
	err(1, "%s", file_name);
183
	err(EX_NOINPUT, "%s", file_name);
184
.Ed
184
.Ed
185
.Pp
185
.Pp
186
Display an error message and exit:
186
Display an error message and exit:
187
.Bd -literal -offset indent
187
.Bd -literal -offset indent
188
if (tm.tm_hour < START_TIME)
188
if (tm.tm_hour < START_TIME)
189
	errx(1, "too early, wait until %s", start_time_string);
189
	errx(EX_DATAERR, "too early, wait until %s", start_time_string);
190
.Ed
190
.Ed
191
.Pp
191
.Pp
192
Warn of an error:
192
Warn of an error:
Lines 195-201 Link Here
195
	warnx("%s: %s: trying the block device",
195
	warnx("%s: %s: trying the block device",
196
	    raw_device, strerror(errno));
196
	    raw_device, strerror(errno));
197
if ((fd = open(block_device, O_RDONLY, 0)) == -1)
197
if ((fd = open(block_device, O_RDONLY, 0)) == -1)
198
	err(1, "%s", block_device);
198
	err(EX_OSFILE, "%s", block_device);
199
.Ed
199
.Ed
200
.Pp
200
.Pp
201
Warn of an error without using the global variable
201
Warn of an error without using the global variable

Return to bug 127220