4.115
Last change
on this file since a0e6c73 was
9b4422a2,
checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24
|
Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.
+ remove occurrences of two blank comment lines
next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
contain CVS Ids
+ If the processing left a blank line at the top of
a file, it was removed.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2007. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | */ |
---|
9 | |
---|
10 | #if HAVE_CONFIG_H |
---|
11 | #include "config.h" |
---|
12 | #endif |
---|
13 | |
---|
14 | #include <stdarg.h> |
---|
15 | |
---|
16 | #include <errno.h> |
---|
17 | #include <fcntl.h> |
---|
18 | #include <pthread.h> |
---|
19 | #include <semaphore.h> |
---|
20 | #include <limits.h> |
---|
21 | |
---|
22 | #include <rtems/system.h> |
---|
23 | #include <rtems/score/object.h> |
---|
24 | #include <rtems/posix/semaphore.h> |
---|
25 | #include <rtems/posix/time.h> |
---|
26 | #include <rtems/seterr.h> |
---|
27 | |
---|
28 | |
---|
29 | /* |
---|
30 | * sem_close |
---|
31 | * |
---|
32 | * Routine to close a semaphore that has been opened or initialized. |
---|
33 | * |
---|
34 | * 11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224 |
---|
35 | */ |
---|
36 | |
---|
37 | int sem_close( |
---|
38 | sem_t *sem |
---|
39 | ) |
---|
40 | { |
---|
41 | register POSIX_Semaphore_Control *the_semaphore; |
---|
42 | Objects_Locations location; |
---|
43 | |
---|
44 | the_semaphore = _POSIX_Semaphore_Get( sem, &location ); |
---|
45 | switch ( location ) { |
---|
46 | |
---|
47 | case OBJECTS_LOCAL: |
---|
48 | the_semaphore->open_count -= 1; |
---|
49 | _POSIX_Semaphore_Delete( the_semaphore ); |
---|
50 | _Thread_Enable_dispatch(); |
---|
51 | return 0; |
---|
52 | |
---|
53 | #if defined(RTEMS_MULTIPROCESSING) |
---|
54 | case OBJECTS_REMOTE: |
---|
55 | #endif |
---|
56 | case OBJECTS_ERROR: |
---|
57 | break; |
---|
58 | } |
---|
59 | |
---|
60 | rtems_set_errno_and_return_minus_one( EINVAL ); |
---|
61 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.