Deleted Added
full compact
pen.c (194497) pen.c (206043)
1/*
2 * FreeBSD install - a package for the installation and maintainance
3 * of non-core utilities.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 5 unchanged lines hidden (view full) ---

14 * Jordan K. Hubbard
15 * 18 July 1993
16 *
17 * Routines for managing the "play pen".
18 *
19 */
20
21#include <sys/cdefs.h>
1/*
2 * FreeBSD install - a package for the installation and maintainance
3 * of non-core utilities.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 5 unchanged lines hidden (view full) ---

14 * Jordan K. Hubbard
15 * 18 July 1993
16 *
17 * Routines for managing the "play pen".
18 *
19 */
20
21#include <sys/cdefs.h>
22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/lib/pen.c 194497 2009-06-19 17:07:38Z brian $");
22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/lib/pen.c 206043 2010-04-01 14:27:29Z flz $");
23
24#include "lib.h"
25#include <err.h>
26#include <libutil.h>
27#include <libgen.h>
28#include <sys/signal.h>
29#include <sys/param.h>
30#include <sys/mount.h>

--- 77 unchanged lines hidden (view full) ---

108
109 if (!find_play_pen(pen, sz))
110 return NULL;
111
112 if (!mkdtemp(pen)) {
113 cleanup(0);
114 errx(2, "%s: can't mktemp '%s'", __func__, pen);
115 }
23
24#include "lib.h"
25#include <err.h>
26#include <libutil.h>
27#include <libgen.h>
28#include <sys/signal.h>
29#include <sys/param.h>
30#include <sys/mount.h>

--- 77 unchanged lines hidden (view full) ---

108
109 if (!find_play_pen(pen, sz))
110 return NULL;
111
112 if (!mkdtemp(pen)) {
113 cleanup(0);
114 errx(2, "%s: can't mktemp '%s'", __func__, pen);
115 }
116 if (chmod(pen, 0700) == FAIL) {
117 cleanup(0);
118 errx(2, "%s: can't mkdir '%s'", __func__, pen);
119 }
120
121 if (Verbose) {
122 if (sz) {
123 humanize_number(humbuf1, sizeof humbuf1, sz, "", HN_AUTOSCALE,
124 HN_NOSPACE);
125 humanize_number(humbuf2, sizeof humbuf2, min_free(pen),
126 "", HN_AUTOSCALE, HN_NOSPACE);
127 fprintf(stderr, "Requested space: %s bytes, free space: %s bytes in %s\n", humbuf1, humbuf2, pen);

--- 63 unchanged lines hidden ---
116
117 if (Verbose) {
118 if (sz) {
119 humanize_number(humbuf1, sizeof humbuf1, sz, "", HN_AUTOSCALE,
120 HN_NOSPACE);
121 humanize_number(humbuf2, sizeof humbuf2, min_free(pen),
122 "", HN_AUTOSCALE, HN_NOSPACE);
123 fprintf(stderr, "Requested space: %s bytes, free space: %s bytes in %s\n", humbuf1, humbuf2, pen);

--- 63 unchanged lines hidden ---