port-solaris.c (181110) | port-solaris.c (221420) |
---|---|
1/* $Id: port-solaris.c,v 1.3 2006/10/31 23:28:49 dtucker Exp $ */ | 1/* $Id: port-solaris.c,v 1.4 2010/11/05 01:03:05 dtucker Exp $ */ |
2 3/* 4 * Copyright (c) 2006 Chad Mynhier. 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * --- 182 unchanged lines hidden (view full) --- 192 tmpl_fd = -1; 193 } 194 if (stat_fd != -1) 195 close(stat_fd); 196 if (ctl_fd != -1) 197 close(ctl_fd); 198} 199#endif | 2 3/* 4 * Copyright (c) 2006 Chad Mynhier. 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * --- 182 unchanged lines hidden (view full) --- 192 tmpl_fd = -1; 193 } 194 if (stat_fd != -1) 195 close(stat_fd); 196 if (ctl_fd != -1) 197 close(ctl_fd); 198} 199#endif |
200 201#ifdef USE_SOLARIS_PROJECTS 202#include <sys/task.h> 203#include <project.h> 204 205/* 206 * Get/set solaris default project. 207 * If we fail, just run along gracefully. 208 */ 209void 210solaris_set_default_project(struct passwd *pw) 211{ 212 struct project *defaultproject; 213 struct project tempproject; 214 char buf[1024]; 215 216 /* get default project, if we fail just return gracefully */ 217 if ((defaultproject = getdefaultproj(pw->pw_name, &tempproject, &buf, 218 sizeof(buf))) > 0) { 219 /* set default project */ 220 if (setproject(defaultproject->pj_name, pw->pw_name, 221 TASK_NORMAL) != 0) 222 debug("setproject(%s): %s", defaultproject->pj_name, 223 strerror(errno)); 224 } else { 225 /* debug on getdefaultproj() error */ 226 debug("getdefaultproj(%s): %s", pw->pw_name, strerror(errno)); 227 } 228} 229#endif /* USE_SOLARIS_PROJECTS */ |
|