* adfCheckParent * */
| 155 | * |
| 156 | */ |
| 157 | RETCODE adfCheckParent(struct Volume* vol, SECTNUM pSect) |
| 158 | { |
| 159 | struct GenBlock block; |
| 160 | |
| 161 | if (adfIsBlockFree(vol, pSect)) { |
| 162 | (*adfEnv.wFct)("adfCheckParent : parent doesn't exists"); |
| 163 | return RC_ERROR; |
| 164 | } |
| 165 | |
| 166 | /* verify if parent is a DIR or ROOT */ |
| 167 | adfReadGenBlock(vol, pSect, &block); |
| 168 | if ( block.type!=T_HEADER |
| 169 | || (block.secType!=ST_DIR && block.secType!=ST_ROOT) ) { |
| 170 | (*adfEnv.wFct)("adfCheckParent : parent secType is incorrect"); |
| 171 | return RC_ERROR; |
| 172 | } |
| 173 | |
| 174 | return RC_OK; |
| 175 | } |
| 176 | |
| 177 | |
| 178 | /* |
no test coverage detected