Changeset 3426
- Timestamp:
- Feb 28, 2011 10:19:23 PM (14 years ago)
- Location:
- pjproject/trunk/pjlib/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/os_info.c
r3424 r3426 89 89 return &si; 90 90 91 si.machine.ptr = si.os_name.ptr = si.sdk_name.ptr = si.info.ptr = ""; 92 91 93 #define ALLOC_CP_STR(str,field) \ 92 94 do { \ … … 109 111 int i, maxtok; 110 112 111 if (uname(&u) != 0) 113 /* Successful uname() returns zero on Linux and positive value 114 * on OpenSolaris. 115 */ 116 if (uname(&u) == -1) 112 117 goto get_sdk_info; 118 113 119 ALLOC_CP_STR(u.machine, machine); 114 120 ALLOC_CP_STR(u.sysname, os_name); … … 227 233 228 234 cnt = pj_ansi_snprintf(tmp, sizeof(tmp), 229 "%s%s /%s/%s%s",235 "%s%s%s%s%s%s%s", 230 236 si.os_name.ptr, 231 237 ver_info(si.os_ver, os_ver), 238 (si.machine.slen ? "/" : ""), 232 239 si.machine.ptr, 240 (si.sdk_name.slen ? "/" : ""), 233 241 si.sdk_name.ptr, 234 242 ver_info(si.sdk_ver, sdk_ver)); -
pjproject/trunk/pjlib/src/pjlib-test/os.c
r2394 r3426 18 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 */ 20 #include "test.h" 21 #include <pj/log.h> 22 #include <pj/os.h> 23 24 #if INCLUDE_OS_TEST 25 int os_test(void) 26 { 27 const pj_sys_info *si; 28 int rc = 0; 29 30 si = pj_get_sys_info(); 31 PJ_LOG(3,("", " machine: %s", si->machine.ptr)); 32 PJ_LOG(3,("", " os_name: %s", si->os_name.ptr)); 33 PJ_LOG(3,("", " os_ver: 0x%x", si->os_ver)); 34 PJ_LOG(3,("", " sdk_name: %s", si->sdk_name.ptr)); 35 PJ_LOG(3,("", " sdk_ver: 0x%x", si->sdk_ver)); 36 PJ_LOG(3,("", " info: %s", si->info.ptr)); 37 38 return rc; 39 } 40 41 #else 20 42 int dummy_os_var; 43 #endif 44 -
pjproject/trunk/pjlib/src/pjlib-test/test.c
r2970 r3426 76 76 #endif 77 77 78 #if INCLUDE_OS_TEST 79 DO_TEST( os_test() ); 80 #endif 81 78 82 #if INCLUDE_RAND_TEST 79 83 DO_TEST( rand_test() ); -
pjproject/trunk/pjlib/src/pjlib-test/test.h
r2970 r3426 48 48 #define INCLUDE_MUTEX_TEST (PJ_HAS_THREADS && GROUP_OS) 49 49 #define INCLUDE_SLEEP_TEST GROUP_OS 50 #define INCLUDE_OS_TEST GROUP_OS 50 51 #define INCLUDE_THREAD_TEST (PJ_HAS_THREADS && GROUP_OS) 51 52 #define INCLUDE_SOCK_TEST GROUP_NETWORK … … 79 80 extern int list_test(void); 80 81 extern int hash_test(void); 82 extern int os_test(void); 81 83 extern int pool_test(void); 82 84 extern int pool_perf_test(void);
Note: See TracChangeset
for help on using the changeset viewer.