Deleted Added
full compact
sys_pipe.c (133790) sys_pipe.c (137355)
1/*
2 * Copyright (c) 1996 John S. Dyson
3 * All rights reserved.
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

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

84 * both directions of a pipe.
85 *
86 * As pipelock() may have to sleep before it can acquire the flag, it
87 * is important to reread all data after a call to pipelock(); everything
88 * in the structure may have changed.
89 */
90
91#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1996 John S. Dyson
3 * All rights reserved.
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

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

84 * both directions of a pipe.
85 *
86 * As pipelock() may have to sleep before it can acquire the flag, it
87 * is important to reread all data after a call to pipelock(); everything
88 * in the structure may have changed.
89 */
90
91#include <sys/cdefs.h>
92__FBSDID("$FreeBSD: head/sys/kern/sys_pipe.c 133790 2004-08-16 01:27:24Z silby $");
92__FBSDID("$FreeBSD: head/sys/kern/sys_pipe.c 137355 2004-11-07 22:16:07Z phk $");
93
94#include "opt_mac.h"
95
96#include <sys/param.h>
97#include <sys/systm.h>
98#include <sys/fcntl.h>
99#include <sys/file.h>
100#include <sys/filedesc.h>

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

379 FILE_LOCK(rf);
380 rf->f_flag = FREAD | FWRITE;
381 rf->f_type = DTYPE_PIPE;
382 rf->f_data = rpipe;
383 rf->f_ops = &pipeops;
384 FILE_UNLOCK(rf);
385 error = falloc(td, &wf, &fd);
386 if (error) {
93
94#include "opt_mac.h"
95
96#include <sys/param.h>
97#include <sys/systm.h>
98#include <sys/fcntl.h>
99#include <sys/file.h>
100#include <sys/filedesc.h>

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

379 FILE_LOCK(rf);
380 rf->f_flag = FREAD | FWRITE;
381 rf->f_type = DTYPE_PIPE;
382 rf->f_data = rpipe;
383 rf->f_ops = &pipeops;
384 FILE_UNLOCK(rf);
385 error = falloc(td, &wf, &fd);
386 if (error) {
387 FILEDESC_LOCK(fdp);
388 if (fdp->fd_ofiles[td->td_retval[0]] == rf) {
389 fdp->fd_ofiles[td->td_retval[0]] = NULL;
390 fdunused(fdp, td->td_retval[0]);
391 FILEDESC_UNLOCK(fdp);
392 fdrop(rf, td);
393 } else {
394 FILEDESC_UNLOCK(fdp);
395 }
387 fdclose(fdp, rf, td->td_retval[0], td);
396 fdrop(rf, td);
397 /* rpipe has been closed by fdrop(). */
398 pipeclose(wpipe);
399 return (error);
400 }
401 /* An extra reference on `wf' has been held for us by falloc(). */
402 FILE_LOCK(wf);
403 wf->f_flag = FREAD | FWRITE;

--- 1229 unchanged lines hidden ---
388 fdrop(rf, td);
389 /* rpipe has been closed by fdrop(). */
390 pipeclose(wpipe);
391 return (error);
392 }
393 /* An extra reference on `wf' has been held for us by falloc(). */
394 FILE_LOCK(wf);
395 wf->f_flag = FREAD | FWRITE;

--- 1229 unchanged lines hidden ---