We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Fix error handling
Hongli Lai (Phusion) (author)
Fri Apr 18 17:10:35 -0700 2008
commit  d5495054fa08681f66bb39878cb4ec03df2acecf
tree    e7b3eb9e58e13d241d548e76829360ca8a835d6e
parent  7ca5c6b4e92b764630527ad40ac1d51b34a32103
...
152
153
154
155
 
156
157
158
159
 
 
 
160
161
162
163
 
 
164
165
 
166
167
168
169
170
171
172
 
173
174
175
...
152
153
154
 
155
156
157
 
 
158
159
160
161
162
 
 
163
164
165
 
166
167
168
169
 
170
171
 
172
173
174
175
0
@@ -152,24 +152,24 @@ thread::thread(const function0<void>& threadfunc, unsigned int stack_size)
0
     if (!m_thread)
0
         throw thread_resource_error();
0
 #elif defined(BOOST_HAS_PTHREADS)
0
- int res = 0, e;
0
+ int res = 0;
0
     pthread_attr_t attr;
0
     
0
- if (pthread_attr_init(&attr) != 0) {
0
- throw thread_resource_error("Cannot initialize thread attributes", e);
0
+ res = pthread_attr_init(&attr);
0
+ if (res != 0) {
0
+ throw thread_resource_error("Cannot initialize thread attributes", res);
0
     }
0
     if (stack_size > 0) {
0
- if (pthread_attr_setstacksize(&attr, stack_size) != 0) {
0
- e = errno;
0
+ res = pthread_attr_setstacksize(&attr, stack_size);
0
+ if (res != 0) {
0
             pthread_attr_destroy(&attr);
0
- throw thread_resource_error("Cannot set thread stack size attribute", e);
0
+ throw thread_resource_error("Cannot set thread stack size attribute", res);
0
         }
0
     }
0
     res = pthread_create(&m_thread, &attr, &thread_proxy, &param);
0
- e = errno;
0
     pthread_attr_destroy(&attr);
0
     if (res != 0)
0
- throw thread_resource_error("Cannot create a thread", e);
0
+ throw thread_resource_error("Cannot create a thread", res);
0
 #elif defined(BOOST_HAS_MPTASKS)
0
     threads::mac::detail::thread_init();
0
     threads::mac::detail::create_singletons();

Comments

    No one has commented yet.