View | Details | Raw Unified | Return to bug 218320 | Differences between
and this patch

Collapse All | Expand All

(-)sysdeps/freebsd/procopenfiles.c (+21 lines)
Lines 322-333 glibtop_get_proc_open_files_s (glibtop *server, glibto Link Here
322
				struct sockaddr_un *sun;
322
				struct sockaddr_un *sun;
323
323
324
				entry.type = GLIBTOP_FILE_TYPE_LOCALSOCKET;
324
				entry.type = GLIBTOP_FILE_TYPE_LOCALSOCKET;
325
/* 64bit inodes */
326
#if __FreeBSD_version > 12000xx
327
				sun = (struct sockaddr_un *)&kif->kf_un.kf_sock.kf_sa_local;
328
#else
325
				sun = (struct sockaddr_un *)&kif->kf_sa_local;
329
				sun = (struct sockaddr_un *)&kif->kf_sa_local;
330
#endif
326
331
327
				if (sun->sun_path[0]) {
332
				if (sun->sun_path[0]) {
328
					char *addrstr;
333
					char *addrstr;
329
334
335
#if __FreeBSD_version > 12000xx
336
					addrstr = addr_to_string(&kif->kf_un.kf_sock.kf_sa_local);
337
#else
330
					addrstr = addr_to_string(&kif->kf_sa_local);
338
					addrstr = addr_to_string(&kif->kf_sa_local);
339
#endif
331
					g_strlcpy(entry.info.localsock.name,
340
					g_strlcpy(entry.info.localsock.name,
332
						  addrstr,
341
						  addrstr,
333
						  sizeof(entry.info.localsock.name));
342
						  sizeof(entry.info.localsock.name));
Lines 335-341 glibtop_get_proc_open_files_s (glibtop *server, glibto Link Here
335
				} else {
344
				} else {
336
					char *addrstr;
345
					char *addrstr;
337
346
347
#if __FreeBSD_version > 12000xx
348
					addrstr = addr_to_string(&kif->kf_un.kf_sock.kf_sa_peer);
349
#else
338
					addrstr = addr_to_string(&kif->kf_sa_peer);
350
					addrstr = addr_to_string(&kif->kf_sa_peer);
351
#endif
339
					g_strlcpy(entry.info.localsock.name,
352
					g_strlcpy(entry.info.localsock.name,
340
						  addrstr,
353
						  addrstr,
341
						  sizeof(entry.info.localsock.name));
354
						  sizeof(entry.info.localsock.name));
Lines 349-360 glibtop_get_proc_open_files_s (glibtop *server, glibto Link Here
349
					entry.type = GLIBTOP_FILE_TYPE_INETSOCKET;
362
					entry.type = GLIBTOP_FILE_TYPE_INETSOCKET;
350
				else
363
				else
351
					entry.type = GLIBTOP_FILE_TYPE_INET6SOCKET;
364
					entry.type = GLIBTOP_FILE_TYPE_INET6SOCKET;
365
#if __FreeBSD_version > 12000xx
366
				addrstr = addr_to_string(&kif->kf_un.kf_sock.kf_sa_peer);
367
#else
352
				addrstr = addr_to_string(&kif->kf_sa_peer);
368
				addrstr = addr_to_string(&kif->kf_sa_peer);
369
#endif
353
				g_strlcpy(entry.info.sock.dest_host,
370
				g_strlcpy(entry.info.sock.dest_host,
354
					  addrstr,
371
					  addrstr,
355
					  sizeof(entry.info.sock.dest_host));
372
					  sizeof(entry.info.sock.dest_host));
356
				g_free(addrstr);
373
				g_free(addrstr);
374
#if __FreeBSD_version > 12000xx
375
				entry.info.sock.dest_port = addr_to_port(&kif->kf_un.kf_sock.kf_sa_peer);
376
#else
357
				entry.info.sock.dest_port = addr_to_port(&kif->kf_sa_peer);
377
				entry.info.sock.dest_port = addr_to_port(&kif->kf_sa_peer);
378
#endif
358
			}
379
			}
359
		} else if (kif->kf_type == KF_TYPE_PIPE) {
380
		} else if (kif->kf_type == KF_TYPE_PIPE) {
360
			entry.type = GLIBTOP_FILE_TYPE_PIPE;
381
			entry.type = GLIBTOP_FILE_TYPE_PIPE;

Return to bug 218320